yiisoft / yiisoft/router

Support base prefix for url generator

Open
#183 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
63
Forks
26
Avg merge
6d 2h
Merged PRs (30d)
1

Description

I want to write an application that will live under some path, e.g. /blog
So I have two ways to write my urls:

  1. Each route should contain /blog
  2. Add a prefix to url generator that will automatically add the prefix to all further urls

If I choose the first option that I need to rewrite all my urls when I want to move from /blog to /.
There are more problems than I described above: proxying, making extensions and etc.

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.

Research direction

Start by locating the URL generator and its existing URL-generation tests; use the issue’s /blog and / examples as the behavior to verify. Done means a configurable prefix is applied consistently to generated URLs, including the proxying and extension cases raised in the issue, with tests covering prefixed and root deployments.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.