ivan1986/subroute

Allows child routers

dev-master 2015-04-13 15:34 UTC

This package is not auto-updated.

Last update: 2024-04-27 11:38:54 UTC


README

Extension for multiple rourets

install default by composer:

"ivan1986/subroute": "*",

Initialize the bundle:

new Ivan1986\SubrouteBundle\SubrouteBundle(),

What It Do

Allows many routing files called for controllers For example, we have::

/{user}/albums/{album}/list
/{user}/albums/{album}/add
/{user}/albums/{album}/delete/{id}
/{user}/albums/{album}/edit/{id}
/{user}/albums/{album}/show/{id}

A problem::

/{user}/albums/{album}/

one for all this urls, and logic one for all urls.

Solution::

Routing(/{user}/albums/{album}/{slug})
run Controller
continue Routing slug whis $this->get('subrouter')->route('album', 'slug');
run other Controller