2014-05-16 21:38:33 +02:00
|
|
|
<?php
|
2014-05-23 23:34:50 +02:00
|
|
|
class View extends \Chibi\Views\View
|
2014-05-16 21:38:33 +02:00
|
|
|
{
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2014-05-20 17:03:47 +02:00
|
|
|
protected function renderExternal($viewName, $context = null)
|
2014-05-16 21:38:33 +02:00
|
|
|
{
|
|
|
|
$view = new View($viewName);
|
2014-05-20 17:03:47 +02:00
|
|
|
$view->context = $context !== null ? $context : $this->context;
|
2014-05-16 21:38:33 +02:00
|
|
|
$view->assets = $this->assets;
|
|
|
|
$view->render();
|
|
|
|
}
|
|
|
|
}
|