toutpratique/controllers/front/PostEditoController.php

36 lines
966 B
PHP
Raw Normal View History

2015-07-30 15:08:21 +02:00
<?php
2015-08-07 17:59:33 +02:00
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
2015-07-30 15:08:21 +02:00
class PostEditoControllerCore extends FrontController
{
public $php_self = 'postedito';
public $postedito;
public function canonicalRedirection($canonical_url = '') {
parent::canonicalRedirection($this->context->link->getPostEditoLink($this->postedito->id));
}
public function init() {
$id_post_edito = Tools::getValue('id_post_edito', 0);
$this->postedito = new CmsPsEdito($id_post_edito, $this->context->language->id);
if (!Validate::isLoadedObject($this->postedito)
|| !$this->postedito->active) {
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
}
parent::init();
}
public function initContent() {
parent::initContent();
$this->context->smarty->assign(array(
// 'path' => Tools::getPath($this->postedito->id, '', FALSE, 'postedito'),
'post' => $this->postedito
));
// $this->setTemplate(_PS_THEME_DIR_.'postedito.tpl');
}
}