/** * Renders output as HTML */ public function render($content_type = self::TYPE_HTML) { $this->environment->addGlobal('_current_route', $this->app->getRequest()->getRoute()->getName()); $content = $this->environment->render($this->template, $this->template_vars); $this->app->coreLogger()->notice("Rendering template {tpl} as {ctype} with code: [{code}]", ['tpl' => $this->template, 'ctype' => $content_type, 'code' => $this->status]); ob_clean(); ob_start(); header("HTTP/1.1 " . $this->status); header("Content-Type: " . $content_type); echo $content; ob_end_flush(); }
/** * @param string $param * @return mixed */ protected function post($param) { return $this->app->getRequest()->post($param); }