forked from IlchCMS/Ilch-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.php
29 lines (25 loc) · 870 Bytes
/
Index.php
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
<?php
/**
* @copyright Ilch 2.0
* @package ilch
*/
namespace Modules\Page\Controllers;
use Modules\Page\Mappers\Page as PageMapper;
class Index extends \Ilch\Controller\Frontend
{
public function showAction()
{
$pageMapper = new PageMapper();
$id = $this->getRequest()->getParam('id');
$locale = $this->getRequest()->getParam('locale');
$page = $pageMapper->getPageByIdLocale($id, $locale);
if ($page == null) {
$this->getView()->set('content', 'page not found');
} else {
$this->getLayout()->set('metaTitle', $page->getTitle());
$this->getLayout()->set('metaDescription', $page->getDescription());
$this->getLayout()->getHmenu()->add($page->getTitle(), $page->getPerma());
$this->getView()->set('content', $page->getContent());
}
}
}