Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Allow Router as Target

Open
#119 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
api, backend

Research direction

Start by locating the Router entry point and reviewing how get() targets are dispatched. Implement nested Router targets so /site/contact reaches the site's contact route and /blog reaches the blog root, then add tests covering the example paths.

Written by the indexing model from the issue text.

Description

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

Dominant language
PHP
Stars
605
Forks
100
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Respect/Rest

All issues in Respect/Rest

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.