PagesController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Lithium: the most rad php framework
  4. *
  5. * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
  6. * @license http://opensource.org/licenses/bsd-license.php The BSD License
  7. */
  8. namespace app\controllers;
  9. /**
  10. * This controller is used for serving static pages by name, which are located in the `/views/pages`
  11. * folder.
  12. *
  13. * A Lithium application's default routing provides for automatically routing and rendering
  14. * static pages using this controller. The default route (`/`) will render the `home` template, as
  15. * specified in the `view()` action.
  16. *
  17. * Additionally, any other static templates in `/views/pages` can be called by name in the URL. For
  18. * example, browsing to `/pages/about` will render `/views/pages/about.html.php`, if it exists.
  19. *
  20. * Templates can be nested within directories as well, which will automatically be accounted for.
  21. * For example, browsing to `/pages/about/company` will render
  22. * `/views/pages/about/company.html.php`.
  23. */
  24. class PagesController extends \lithium\action\Controller {
  25. // !--Waring--! this makes all pages accessibe to non-logged in uses.
  26. // :TODO: Fix this.
  27. public $publicActions = array('view');
  28. public function view() {
  29. $path = func_get_args() ?: array('home');
  30. return $this->render(array('template' => join('/', $path)));
  31. }
  32. }
  33. ?>