szurubooru/src/View.php
Marcin Kurczewski 50e4b40721 Upgraded to newest chibi
- Separate non-static router class
- Moved some setup code to new method, Core::init
- Persistent database connection between tests
2014-05-23 23:34:50 +02:00

22 lines
561 B
PHP

<?php
class View extends \Chibi\Views\View
{
public static function renderTopLevel($viewName, $assets)
{
$context = Core::getContext();
$view = new View($viewName);
$view->registerDecorator(new \Chibi\Util\Minify());
$view->registerDecorator($assets);
$view->context = $context;
$view->assets = $assets;
$view->render();
}
protected function renderExternal($viewName, $context = null)
{
$view = new View($viewName);
$view->context = $context !== null ? $context : $this->context;
$view->assets = $this->assets;
$view->render();
}
}