Rest icon indicating copy to clipboard operation
Rest copied to clipboard

Allow Router as Target

Open m42e opened this issue 8 years ago • 3 comments

This is a feature I really miss in Respect/Rest is, to allow subrouters.

Eg. define sub routers:

$blog = new Router;
$blog->get('/', function() {
    return 'This is my Blog';
});

$site = new Router;
$site->get('/', function() {
    return 'This is the main site';
});
$site->get('/contact', function() {
    return 'Contact';
});

And then have a master:

$r3 = new Router;
$r3->get('/blog', $blog);
$r3->get('/site', $site);

If you like the Idea, I may also offer an implementation, but this takes a week or two.

So that /site/contact will result in Contact and /blog will result in This is my Blog

m42e avatar Sep 22 '15 07:09 m42e

Seconded, this would be extremely useful.

emestee avatar Dec 28 '15 10:12 emestee

it would be awesome

Janokapapa avatar Jan 03 '16 06:01 Janokapapa