toutpratique/override/controllers/front/IndexController.php
ToutPratique e03f45136e push prod
2016-08-02 10:22:32 +02:00

27 lines
705 B
PHP

<?php
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
require_once _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, 3),
'posts_home_2' => array_slice($posts, 3, 2),
'posts_home_3' => array_slice($posts, 5, 3),
// 'posts_home_4' => array_slice($posts, 10, 3),
// 'posts_home_5' => array_slice($posts, 13, 1)
));
parent::initContent();
}
}