Download the PHP package adelowo/cfar without Composer
On this page you can find all versions of the php package adelowo/cfar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package cfar
Short Description Using Controllers with Aura.Router
License MIT
Homepage https://github.com/adelowo/cfar
Informations about the package cfar
CFAR - Controller for Aura Router
This library was written to enable users of Aura.Router make use of symfony/laravel "type" controllers.
Already using CFAR , Migrate to: 1.2
Installation
You are recommended to make use of the latest available PHP version, but CFAR should run on >=5.5.
CFAR has a dependency, which is Aura.Router. >=1.0 releases require Aura.Router 3.x while <=0.2.1 requires Aura.Router 2.x .
Install CFAR via one of the following methods :
- Composer :
If you are still using Aura.Router 2.x, please install 0.x
-
Repo Cloning :
- Download a release
If downloading the library without composer or cloning directly from the repository, you'd have to write an autoloader yourself
Usage
Cfar doesn't require any special config - other than specifying the class that acts as your controller (namespaced) and method to invoke - you'd still write your routes as specified in Aura.Router's (3.x) doc.
Aura.Router 3 is a big improvement to the much loved router with it being broken into many parts such as a Mapper, Matcher, Route (that contains the matched route).
Internally, Cfar uses PHP's Reflection Api.
By default, Cfar would search and invoke a method called
indexAction
Below is a little snippet that shows Aura.Router and Cfar fully integrated, an index.php
file and controllers for the routes would be written.
The constructor of the controller would always receive a container. Might be null or a valid one. Your call.
Parameters would be passed to the invoked method in the same order defined in the route.. A method for
/users/{id}/{name}
should have two parameters, where the first one would be passed the value captured by the router for{id}
and vice-versa
License
MIT
All versions of cfar with dependencies
aura/router Version ^3.0
container-interop/container-interop Version ^1.1