Download the PHP package redcatphp/route without Composer

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

No longer actively maintained. I work now with NodeJS and I recommand you to take a look at express

Route your application's requests

Route is a micro-framework designed for manage requests with flexibility and simplicity.

FrontController

This is a basic front-controller class which you can extends to build the front map of your application. It's build with a router that will solve the request. Is implementing the ArrayAccess interface and runFromGlobals method which is used in the generic RedCat's index.php.
Extending:

And then, use it:

Append and prepend methods:

Z-index like api in third parameter (default is zero)
It will look first for ".stuff" matching, then "test/more", and finally "test/":

Parameters automatic wrap:

Empty url handling:

Lazy loading match, array containing first element starting with "new:", the object will be instantiated only if is necessary (previous didn't match):

Lazy loading callback, array containing first element or string starting with "new:", the object will be instantiated only if is necessary (matching):

Run

Router

The router is the component which is used by FrontController to map, append and prepend pair of match to behaviour. It support the methods explained before in FrontController except runFromGlobals.

Match

The basic match components are distributed under the RedCat\Route\Match namespace but there is also some examples of specific match in the RedCat\Plugin\RouteMatch namespace. The only rule to make a Match object is that he have to be callable implementing __invoke magic method. You can also use php Closure also called anonymous function.

Url

Url is a tiny helper for extract some simple components from Url.


All versions of route with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 redcatphp/route contains the following files

Loading the files please wait ....