xssbook2/web/_model/apps/home.php

23 lines
435 B
PHP
Raw Normal View History

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