Source for file View.class.php
Documentation is available at View.class.php
* @copyright 2009-2010 NADEO
* View rendering features
* You can use this method from within a view to render another view.
* Usefull for things like rendering a navigation menu on every page.
* View::render('header'); // Renders /views/header.php
* View::render('Home', '_navigation'); // Renders /views/Home/_navigation.php
public static function render($controllerName, $actionName=
null)
$viewFilename =
self::getFilename($controllerName,$actionName);
$viewFilename =
self::getFilename($controllerName, $actionName,
throw
new ViewNotFoundException($controllerName.
'::'.
$actionName);
public static function getFilename($controllerName, $actionName=
null, $path=
APP_MVC_VIEWS_PATH)
if($controllerName &&
$actionName)
return $path.
$controllerName.
'/'.
$actionName.
'.php';
return $path.
$controllerName.
'.php';
class ViewNotFoundException extends MVCException {}