Skip to content
This repository was archived by the owner on Dec 23, 2019. It is now read-only.

URL Routing

Christian Barras edited this page Jun 2, 2014 · 1 revision

Furrows allows you to use pretty urls with url rewriting.

It's a choice to explicitly use this pattern for urls

http://mydomain/my/path/to/my/app/folder/ controller name / method name / first parameter name : first parameter value / second parameter name : second parameter value / ...

You can see an example here

http://localhost/flashfood/flashfood/api/zones/createZone/customers_id:25/lattitude:34.786546/longitude:12.984576/name:capitole


Note:

Furrows uses the ReflexionClass in order to call the controller's method by providing a parameters validation.

Example:

http://mydomain.com/posts/all
class Posts extends Controller
public function all()
{
//put your logic here
}

http://mydomain.com/posts/view/id:123 or http://mydomain.com/posts/view/
class Posts extends Controller
public function view($id = null)
{
//put your logic here
}

http://mydomain.com/posts/delete/id:123
class Posts extends Controller
public function view($id)
{
//put your logic here
}

Clone this wiki locally