class controller_index extends controller public user function __const

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?
class controller_index extends controller
{
public
$user;
function __construct()
{
parent::__construct('index');
$this->user = new user();
}
public function action_index()
{
global $fenom;
$_product = $this->model->DB->query('SELECT * FROM `products` ORDER BY `id` DESC LIMIT 8');
foreach($_product AS $_product2) $_products[] = $_product2;
$_hots = $this->model->DB->query('SELECT * FROM `hots`');
foreach ($_hots AS $_hots2) $_hot[] = $_hots2;
$fenom->assign('_hot', $_hot);
$fenom->assign('_products', $_products);
$fenom->assign('product', $product);
$fenom->display('index/index.tpl');
}
}