public function render() { if (Session::getFlash('msg')) { $flash = new HtmlElement("div", ["class" => "alert alert-" . Session::getFlash('msg')->type], Session::getFlash('msg')->message); $flash->nestElement("button", ["type" => "button", "class" => "close", "data-dismiss" => "alert"], "×"); return $flash; } return ""; }
public function render() { $form = new Form('login'); $form->addTextElement('username'); $form->addPasswordElement('password'); $form->addSubmitElement('Login'); $alert = ''; if (Session::getFlash('msg')) { $alert = new HtmlElement('div', ['class' => 'alert alert-error'], Session::getFlash('msg')); } return new RenderGroup('<h1>Please Login</h1>', $alert, $form); }