renderer : add the html support directely in renderer
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2208 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
21
renderer.php
21
renderer.php
@@ -97,4 +97,25 @@ class renderer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** @param mixed $data The data to display.*/
|
||||
static function html ($viewclass, $viewmethod, $data,
|
||||
$layoutfile = "views/layout.html", $route = null)
|
||||
{
|
||||
if ($layoutfile !== false && ! file_exists ($layoutfile))
|
||||
throw new Exception ("Layout file $layoutfile not found", 500);
|
||||
require_once ("domframework/outputhtml.php");
|
||||
if ($route === null)
|
||||
$route = new route ();
|
||||
$html = new outputhtml ();
|
||||
$replacement = array ("{baseurl}"=>$route->baseURL (),
|
||||
"{baseurlresource}"=>$route->baseURLresource ());
|
||||
|
||||
echo $html->out ($data,
|
||||
FALSE,
|
||||
$viewclass, $viewmethod,
|
||||
$layoutfile,
|
||||
$replacement);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user