diff options
author | Michael Francis <edude03@gmail.com> | 2011-05-28 13:28:16 -0400 |
---|---|---|
committer | Michael Francis <edude03@gmail.com> | 2011-05-28 13:28:16 -0400 |
commit | 2389d66da849798f8d4ec5f10e3b07c11da49185 (patch) | |
tree | e22556d12982395b469a23420c662662e3e064cc /controllers/PagesController.php | |
download | otakuhub-2389d66da849798f8d4ec5f10e3b07c11da49185.tar.xz |
Initial Commit
Diffstat (limited to 'controllers/PagesController.php')
-rw-r--r-- | controllers/PagesController.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/controllers/PagesController.php b/controllers/PagesController.php new file mode 100644 index 0000000..47b88d2 --- /dev/null +++ b/controllers/PagesController.php @@ -0,0 +1,36 @@ +<?php +/** + * Lithium: the most rad php framework + * + * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org) + * @license http://opensource.org/licenses/bsd-license.php The BSD License + */ + +namespace app\controllers; + +/** + * This controller is used for serving static pages by name, which are located in the `/views/pages` + * folder. + * + * A Lithium application's default routing provides for automatically routing and rendering + * static pages using this controller. The default route (`/`) will render the `home` template, as + * specified in the `view()` action. + * + * Additionally, any other static templates in `/views/pages` can be called by name in the URL. For + * example, browsing to `/pages/about` will render `/views/pages/about.html.php`, if it exists. + * + * Templates can be nested within directories as well, which will automatically be accounted for. + * For example, browsing to `/pages/about/company` will render + * `/views/pages/about/company.html.php`. + */ +class PagesController extends \lithium\action\Controller { + // !--Waring--! this makes all pages accessibe to non-logged in uses. + // :TODO: Fix this. + public $publicActions = array('view'); + public function view() { + $path = func_get_args() ?: array('home'); + return $this->render(array('template' => join('/', $path))); + } +} + +?>
\ No newline at end of file |