Skip to content

Inserir função no "Config/Router" para configurar a resposta em situação de erro. #1

Description

@ahcor

Inserir função no Config/Router para configurar a resposta em situação de erro.

Sugestão de sintaxe:

namespace Config;

class Router 
{
    function routers(&$router)
    {
        //Página inicial
        $router->respond('get', '/', 'Site\Front::page');
         ...
        
        //Errors
        $router->error('404', 'get', 'Site\Error::respondGet404')
               ->error('404', 'post|send|delete', 'Site\Error::respondPost404')
               ->error('414', 'get', 'Site\Error::respondGet414');
        ...    
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions