Download the PHP package terrydjony/routeria without Composer

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

Routeria

Routeria is a lightweight and easy-to-use routing component.

Installing

Routeria installation using Composer

Usage

The installed Routeria and all of the components is in the vendor folder.
In order to use it, you just need to require the autoload.
And, you need to load the namespace using use keyword.

Configuration (.htaccess)

Before using Routeria, you need to turn your rewrite engine on and add rules so any requests to non-existing directory or filename will be rewritten to index.php.

Simple Callback Routing

For a simple callback route, you just need to use Routeria class which belongs to the Routeria namespace.
The Request component of Symfony HttpFoundation is required to tell the request path to the router.

Don't forget to write line ->route($request->getPathInfo(), $request->getMethod()); to make it work

Using Named Parameters

The order of parameters in the callback doesn't matter.
You just need to specify all the necessary variables.

There are six placeholders available,
INT for integers (regex: [0-9]+)
ALPHA for alphabets (regex: [a-zA-Z-]+)
ALNUM for alphanumeric characters (regex: [a-zA-Z0-9
-]+)
HEX for hexadecimals (regex: [0-9A-F]+)
ALL for all characters (regex: .+)
WORD is an alias for ALPHA

Routing with specific HTTP Method

You can also perform other http methods routing easily. (even the custom one)

Different method, different route.

Dispatch Controller

You can also dispatch a controller using Routeria.

If you go to '/user/terry/35', the router will dispatch the getInfo method so it prints 'Hello terry ID: 35'.
Don't forget to specify the namespace if the class has.

Converting arguments

The converter in this example changes all hypens into spaces in the title argument.
So, if you go to '/posts/lorem-ipsum-dolor-sit-amet', it will print <h1>lorem ipsum dolor sit amet</h1>.
Notice that the argument 'lorem-ipsum-dolor-sit-amet' has been converted into 'lorem ipsum dolor sit amet' before the callback fires.

Custom route collection

You can define your own route collection by implementing RouteProviderInterface.

You need your own blog controller to make it work.

Contribute to this library

Please contribute to this project by forking it, make good commits and then perform a pull request.
Thanks for your support.


All versions of routeria with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
symfony/http-foundation Version >=2.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 terrydjony/routeria contains the following files

Loading the files please wait ....