xssbook2/web/_model/apps/home.php
2024-03-30 12:14:42 -04:00

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;
}
}