2024-03-30 02:29:56 +00:00
|
|
|
<?php /* Copyright (c) 2024 Freya Murphy */
|
2024-03-30 16:14:42 +00:00
|
|
|
class Home_model extends Model {
|
2024-03-30 02:29:56 +00:00
|
|
|
|
2024-03-30 16:14:42 +00:00
|
|
|
function __construct($load) {
|
|
|
|
parent::__construct($load);
|
|
|
|
}
|
|
|
|
|
|
|
|
private function get_posts(): array {
|
2024-03-30 02:29:56 +00:00
|
|
|
return $this->db
|
|
|
|
->select('*')
|
|
|
|
->from('admin.post')
|
|
|
|
->limit(20)
|
|
|
|
->rows();
|
|
|
|
}
|
|
|
|
|
2024-03-30 16:14:42 +00:00
|
|
|
public function get_data(): array {
|
2024-03-30 02:29:56 +00:00
|
|
|
$data = parent::get_data();
|
|
|
|
$data['title'] = lang('title');
|
|
|
|
$data['posts'] = $this->get_posts();
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
}
|