Download the PHP package slaxweb/router without Composer
On this page you can find all versions of the php package slaxweb/router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download slaxweb/router
More information about slaxweb/router
Files in slaxweb/router
Package router
Short Description Router component for the SlaxWeb/Framework
License MIT
Informations about the package router
Router
The Router Component is one of the core components of the SlaxWeb/Framework, but it can be used separately as well. It relies on the following components:
The Router helps you route your incoming requests to the correct code, and is one of the essential components in modern web applications, especially those who rely on a single entry point. With a Router, you control where your incoming requests are handled.
Installation
Installation is currently available only through composer, and can be achieved by putting the following into your composer.json file:
Usage
Initialization of the Router can be a little bit overwhelming, especially because it relies on two other components, which also need to be initialized separately. Because of this, the Router provides two convenient ways of initializing it, a Factory and a Service Provider if you happen to use the Pimple Dependency Injection Container.
This is just to get you started. Full documentation will follow in the future.
Factory
The Factory provides static methods to initialize the Router properly, and help you get your Route definitions to the Router. This example does not show how to prepare the Config component, which is required by the Logger component. For this please refer to the Config and Logger components.
Now if you visit http://yourdomain.com/script.php/myUrl in your browser, you should see 'my content' in your browser.
Service Provider
Using the service provider is quite similar, and can make it a bit easier for you.
And if you visit http://yourdomain.com/script.php/myUrl again, you should again see 'my content' in your browser.
All versions of router with dependencies
slaxweb/hooks Version ~0.6
slaxweb/logger Version ~0.5
slaxweb/config Version ~0.3
slaxweb/getset Version ~0.1
symfony/http-foundation Version ~3.0