toutpratique/override/controllers/front/IndexController.php
2015-08-07 17:51:31 +02:00

24 lines
617 B
PHP

<?php
include _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
include _PS_MODULE_DIR_.'cmsps/classes/CmsPsPost.php';
class IndexController extends IndexControllerCore
{
public function initContent() {
$id_lang = Context::getContext()->language->id;
$edito = CmsPsEdito::getLast($id_lang);
$posts = CmsPsPost::getPostHome($id_lang);
$this->context->smarty->assign(array(
'edito' => $edito,
'posts_home_1' => array_slice($posts, 0, 4),
'posts_home_2' => array_slice($posts, 4, 3),
'posts_home_3' => array_slice($posts, 7, 3),
'posts_home_4' => $posts
));
parent::initContent();
}
}