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

35 lines
903 B
PHP
Raw Permalink Normal View History

2013-10-10 02:44:53 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides static pages
*
* @package OSB
* @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),
));
}
}
?>