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
2012-01-12 19:55:12 +11:00

34 lines
888 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) {
$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),
));
}
}
?>