Skip to content

Latest commit

 

History

History
executable file
·
43 lines (32 loc) · 831 Bytes

File metadata and controls

executable file
·
43 lines (32 loc) · 831 Bytes

Criação do controller Error

Criar a apsta /var/www/html/app-mvc/src/Controller

E dentro dela o arquivo

ErrorController.php

Contendo o código abaixo:

<?php

/**
 * Class Error
 *
 * Please note:
 * Don't use the same name for class and method, as this might trigger an (unintended) __construct of the class.
 * This is really weird behaviour, but documented here: http://php.net/manual/en/language.oop5.decon.php
 *
 */
namespace Mvc\Controller;

class ErrorController
{
  
  /**
     * PAGE: index
     * This method handles the error page that will be shown when a page is not found
     */
    public function index()
    {
        // load views
        require APP . 'view/_templates/header.php';
        require APP . 'view/error/index.php';
        require APP . 'view/_templates/footer.php';
    }
}