Download the PHP package tuum/router without Composer

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

Yet-another small router component for PHP.

MIT Licence

Why another Routing component?

I was looking for a routing component that works as one-liner and have features like;

and I could not find one. It is possible to use just a regular expressions for the above purpose, but I found it too difficult to write a correct reg-ex everytime.

Matcher

Basic usage

If the $path matches with $pattern, the method returns array of matched information. Otherwise it returns an empty array.

Examples

matching to method , with integer parameter .

matching to any method, starting with .

The Matcher class has no dependencies, with less than 100 lines of code including comments.

Closure style

Available as a static method as well as a closure style.

Returned value

The method returns an array of matched parameters, or empty array if failed to match.

The returned values are preg-match result, and some more. Please do not use strings as parameters.

Available Route Patterns

the route patterns.

route

Generally speaking, start route pattern with slash ('/'). In case the route contains a colon (':') but do not want to specify method, make sure the route start with slash.

parameter

syntax is .

Parameter name must be alphabet and underscore only ([_0-9a-zA-Z]+), and matches only to alphabets, hyphen, and underscore ([-_0-9a-zA-Z]+).

Currently, only type of 'i' for integer is supported, i.e. .

method

Method name must be consisted of only alphabets. (method name cannot contain colon.)

To ignore the method in the match, use asterisk as the method value, like;

trailing route (*)

To match any remaining route, use *,

Router Class

Anything below are implemented to make this looks like a package.

Router class takes an array of patterns and its , and matches against a path. A method adds a pattern and one by one.

If matched, the router returns an array of the whatever the handler and matched parameter.

Handler can be anything. It just returns whatever it is set.

RouteCollection and Handler Class

use RouteCollection and Handler objects for creating patterns with ease.

Currently, the $router returns matched result as an array like any other. But it maybe easier to just return Handle object (if handle is the Handle object)...

Route Class

The method will return class if RouteCollection is used (i.e. Handler class is the $handler).

Handler and Route API list

The (RouteCollector) uses object to setup route information.

Handler has following methods.

Route class has following methods for reading matched information.

Grouping Routes

Use method to assigning same properties and/or matching pattern to a group of routes, as follows.

ReverseRoute

To-be-altered.

usage:


All versions of router with dependencies

PHP Build Version
Package Version
No informations.
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 tuum/router contains the following files

Loading the files please wait ....