/** * Construct view respons. * @param int $status Status code. * @param View $view The view. * @param string $template Template name. * @param array $data Addtional data for template. * @param bool $withLayout Whether or not to render the layout. */ public function __construct($status, View $view, $template = null, $data = array(), $withLayout = true) { parent::__construct($status, Utilities::getContentType($template)); $this->view = $view; $this->template = $template; $this->data = $data; $this->withLayout = $withLayout; }
/** * Construct asset response. * @param string $file Path to asset. */ public function __construct($file) { parent::__construct(Http::OK, Utilities::getContentType($file)); $this->file = $file; $this->modified = filemtime($file); }