Skip to content

Allow Router as Target #119

Description

@m42e

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions