50e4b40721
- Separate non-static router class - Moved some setup code to new method, Core::init - Persistent database connection between tests
22 lines
561 B
PHP
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();
|
|
}
|
|
}
|