toutpratique/override/controllers/front/IndexController.php

26 lines
698 B
PHP
Raw Normal View History

2015-07-29 16:58:18 +02:00
<?php
2015-10-30 13:23:09 +01:00
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsPost.php';
2015-07-29 16:58:18 +02:00
class IndexController extends IndexControllerCore
{
2015-10-12 11:25:23 +02:00
public function initContent()
{
2015-07-29 16:58:18 +02:00
$id_lang = Context::getContext()->language->id;
2015-07-30 15:08:21 +02:00
$edito = CmsPsEdito::getLast($id_lang);
2015-07-29 16:58:18 +02:00
$posts = CmsPsPost::getPostHome($id_lang);
$this->context->smarty->assign(array(
2015-07-30 15:08:21 +02:00
'edito' => $edito,
2015-07-29 16:58:18 +02:00
'posts_home_1' => array_slice($posts, 0, 4),
'posts_home_2' => array_slice($posts, 4, 3),
'posts_home_3' => array_slice($posts, 7, 3),
2015-10-01 15:58:00 +02:00
'posts_home_4' => array_slice($posts, 10, 3),
'posts_home_5' => array_slice($posts, 11, 1)
2015-07-29 16:58:18 +02:00
));
parent::initContent();
}
}