render(); } public function Title() { return $this->title; } protected function setMessage($msg, $type = 'msg') { if(is_array($msg)) { $type = 'list'; } $this->messages[] = [$type, $msg]; } public function render() { echo ''; foreach ($this->messages as $item) { $type = $item[0]; $msg = $item[1]; switch ($type) { case 'h2': echo '

'.$msg.'

'.PHP_EOL; break; case 'h3': echo '

'.$msg.'

'.PHP_EOL; break; case 'list': echo ''; break; default: echo $msg.'
'.PHP_EOL; break; } } echo '

Success!

'; } }