This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/static_page/classes/controller/staticpage.php
2013-10-10 13:44:53 +11:00

36 lines
923 B
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides static pages
*
* @package OSB
* @subpackage Page
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_StaticPage extends Controller_TemplateDefault {
/**
* By default show a menu of available categories
* @todo Only show categories according to their validity dates
*/
public function action_view() {
$id = $this->request->param('id');
$sp = ORM::factory('staticpage',$id);
if (! $sp->loaded())
Request::current()->redirect('staticpage_category/index');
Breadcrumb::name($this->request->uri(),$sp->staticpage_translate->find()->title);
Block::add(array(
'title'=>$sp->staticpage_translate->find()->title,
'body'=>View::factory($this->viewpath())
->set('record',$sp),
));
}
}
?>