public function __construct() {
$this->modelMaterials = new Model_Category_Materials();
$this->modelVideo = new Model_Category_Video();
$this->view = new View();
}
function action_index() {
$materials = $this->modelMaterials->get_category_materials();
$video = $this->modelVideo->get_videos();
$this->view->generate('content_view.php','template_view.php', ['materials' => $materials, 'video' => $video]);
}
function action_index() {
$materials = $this->model->get_category_materials();
$this->view->generate('content_view.php','template_view.php', [ 'materials' => $materials, ... ] );
}
<?php
class View
{
public $template_view;
function generate($content_view, $template_view, $data = []) {
extract( $data );
include 'application/views/'.$template_view;
}
}
SELECT `h`.`iduser`, `h`.`hisuser`, `r`.`id`, `r`.`text`
FROM `his` AS `h`
INNER JOIN `rew` AS `r` ON `r`.`id` = `h`.`hisuser`
WHERE `h`.`iduser` = {определенный id}