Download the PHP package hnrazevedo/router without Composer

On this page you can find all versions of the php package hnrazevedo/router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package router

# Router @HnrAzevedo

Maintainer Latest Version Scrutinizer Code Quality Build Status PHP from Packagist Total Downloads

Router is a simple friendly URL abstractor. It can be used in an easy and practical way, either individually in a static way, or together as a middleware and now as an attribute with PHP 8. Its author is not a professional in the development area, just someone in the Technology area who is improving their knowledge.

O Router é um simples abstrator de URL amigável. Ele pode ser utilizada de maneira fácil e prática, tanto individualmente de forma estática, quanto em conjunto como middleware e agora como atributo com o PHP 8. Seu autor não é um profissional da área de desenvolvimento, apenas alguem da área de Tecnologia que está aperfeiçoando seus conhecimentos.

Highlights

Installation

Router is available via composer.json:

or in at terminal

Configure server

Nginx

nginx.conf

Apache

.htaccess

Documentation

For more details on the use and configuration of the Router, see the example folder with details on component targeting

Para mais detalhes sobre a utilização e configuração do Router, veja a pasta de exemplos com detalhes no diretório do componente

Errors

In the static use of the Router, if an inexistent page error is returned, an Exception will be thrown

When used as middleware, a 404 response is returned

Na utilização estática do Router, caso retorne erro de página inexistente, será lançada uma Exception Na utilização como middleware, é retornado uma resposta 404

Access methods

Available protocols

Ajax

To use the Ajax call, it is necessary to define REQUEST_METHOD as AJAX:

Para utilizar a chamada Ajax, é necessário a definição do REQUEST_METHOD como AJAX:

REST request

Router Attributes

Attribute routing works the same as role routing, with just a few caveats:

Both means of declaring routes can be used together.

O roteamento por atributo funciona da mesma forma que o roteamento por função, apenas com algumas resalvas:

Ambos os meios de declaração de rotas podem ser usados em conjunto.

Example:

It is necessary to load the classes with routes in the same way as the route declaration files, it is interesting for both methods that the loading is done directly by composer.

Loading can be done directly with a class or with the directory.

É necessário fazer o carregamento das classes com rotas da mesma forma que os arquivos de declarações de rota, é interessante para ambos os métodos, que o carregamento seja feito diretamente pelo composer.

O carregamento pode ser feito diretamente com uma class ou com o diretório

Router methods

get

post

ajax

middleware

name

Defines a name for the route, if you want to call dynamically by name

attribute

Defines attributes to route, to be used dynamically

Returning an attribute

Returning all attributes

before

Runs before starting the work of the accessed route

after

Executes after completing the work of the accessed route

beforeAll

Runs before work on any route

NOTE: execute the beforeAll method before the before method

after All

Runs after completing work on any route

NOTE: execute the afterAll method before the after method

group

Set the group to use a common filter or before/after methods

groupAttribute

Defines attributes on all routes in the group

NOTE:If the attribute has already been defined directly on the route, it will be disregarded here

groupMiddlewares

Defines middleware for all group members

beforeGroup | afterGroup

Defines actions to be taken before and after any group member is triggered

REST

Parameters

Optional parameters

Regular Expression Constraints

Route definition

Protocols

Current route

load

run

Cache

Example of caching in SESSION

Definition order

Routing loading is a priority with static routes (without parameters)

O carregamento das rotas é prioritário com as rotas estáticas (sem paramêtros)

Support

Security: If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Se você descobrir algum problema relacionado à segurança, envie um e-mail para [email protected] em vez de usar o rastreador de problemas.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of router with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
opis/closure Version ^3.5@dev
hnrazevedo/http Version dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hnrazevedo/router contains the following files

Loading the files please wait ....