22 lines
435 B
PHP
22 lines
435 B
PHP
<?php /* Copyright (c) 2024 Freya Murphy */
|
|
class Home_model extends Model {
|
|
|
|
function __construct($load) {
|
|
parent::__construct($load);
|
|
}
|
|
|
|
private function get_posts(): array {
|
|
return $this->db
|
|
->select('*')
|
|
->from('admin.post')
|
|
->limit(20)
|
|
->rows();
|
|
}
|
|
|
|
public function get_data(): array {
|
|
$data = parent::get_data();
|
|
$data['title'] = lang('title');
|
|
$data['posts'] = $this->get_posts();
|
|
return $data;
|
|
}
|
|
}
|