Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ErrorController extends Controller implements IErrorController
- {
- /** @var boolean */
- public $isProduction = false;
- /** @var array */
- private static $codes = array(
- 404 => "Stránka nebyla nalezena",
- 500 => "Na straně serveru se vyskytla chyba",
- );
- public function process(Exception $exception)
- {
- if ($this->isProduction)
- {
- $template = new Template("error.phtml");
- $template->code = $exception->getCode();
- $template->text = self::$codes[$exception->getCode()];
- $this->layout->obsah = $template;
- }
- else
- {
- $template = new Template("error.phtml");
- $template->text = $exception->getMessage();
- $this->layout->obsah = $template;
- }
- }
- }
Add Comment
Please, Sign In to add comment