Download the PHP package quimcalpe/router without Composer

On this page you can find all versions of the php package quimcalpe/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

quimcalpe/router

Version License Build Status Code Coverage Scrutinizer Code Quality

Regexp based Router, easy to use and with a rich feature set. It includes various built-in dispatchers, and we also provide an interface to develop fully customized dispatchers for your project.

Install

Via Composer

Requirements

The following versions of PHP are supported by this version.

Basic Usage

Constructor optional Route[] parameter

You can alternatively pass an array of Route objects to Router's constructor, and routes will be created;

This array can be included from another file, enabling config separation in a simple way.

Route Providers

If you want to import a bunch of Routes from a specific package/namespace/bundle and you want to keep routes organized, you can use Route providers, define your provider like this:

And then initialize the Router with:

Route Patterns

Basic regexp patterns are supported, some are already included:

Patterns can be used this way:

You can define your own patterns:

Wildcards

Wildcards in routes can be used with WildcardDispatcher:

Request Response

Standard Request - Response workflow with Symfony HttpFoundation components is supported with RequestResponseDispatcher:

PSR-7 HTTP Message

A built-in PSR7Dispatcher is available to work with PHP-FIG's PSR-7 HTTP Message standard implementations, an example using Zend Diactoros and a simple PSR-7 Response Sender would look like this:

Custom Dispatcher

You can create your custom Dispatcher, implementing DispatcherInterface:

QuimCalpe\Router\Route\ParsedRoute is a small Value Object with controller() and params() methods already parsed by Router::parse.

Trailing slash

Default behaviour is to honour distinction between routes with and wothout trailing slashes:

You can disable this behaviour with disableTrailingSlashCheck method:

Testing

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.1
symfony/http-foundation Version ^6.2
psr/http-message Version ^1.0
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 quimcalpe/router contains the following files

Loading the files please wait ....