function __construct(Request &$request, $content, $status = 200) { if ($content instanceof Viewable) { $content = $content->get_view(); } parent::__construct($request, View::factory('page', array('content' => $content)), $status); }
function __construct(Request &$request, \Exception $exception) { $this->exception = $exception; try { if ($exception instanceof Viewable) { $exception_view = $exception->get_view(); } else { $exception_view = View::factory('exception', array('exception' => $exception)); } $this->view = View::factory('page', array('content' => $exception_view)); if ($exception instanceof \Sedra\Exception) { $status = $exception->getCode(); } else { $status = 500; } $this->headers['content-type'] = 'text/html'; } catch (\Exception $e) { $this->body = 'Error ' . $e->getCode() . "\r\n\r\n" . $e->getMessage(); $status = 500; $this->headers['content-type'] = 'text/plain'; } parent::__construct($request, $status); }
function __construct(Request &$request, $content, $status = 200) { parent::__construct($request, View::factory('admin/page', array('content', $content)), $status); }
public function get_view() { return View::factory($this->get_view_name(), $this->get_view_data()); }
public function handle_article(Request $request, $arguments) { # XXX $articles = $this->models['articles']->get_latest(); $article = array(); return View::factory('blog/article', array('article' => $article)); }
public function get_view() { return View::factory($this->default_view, array('exception' => $this)); }