blob: 47b88d2dfc0c884924ba89b358a22f082758d27d (
plain)
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
30
31
32
33
34
35
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)));
}
}
?>
|