Upstatement / Upstatement/routes

Make more (all?) AltoRouter options available

Open
#11 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
PHP
Stars
201
Forks
43
PR merge metrics
No merged PRs in 30d

Description

AltoRouter already provides optional parameters, but Timber doesn't support them because this router strips question marks. I would like to use optional parameters, and maybe it wouldn't be a bad idea to just provide access to the AltoRouter object?

Something like

Routes::getRouter()->addRoutes([
['GET','/users/[i:id?]', function($params) {
etc...
})

Contributor guide

No contributing guide indexed for this repository

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 at the Routes::getRouter() entry point and trace where AltoRouter route definitions are processed, especially how question marks are stripped. Check whether the router object can expose AltoRouter's addRoutes behavior for optional parameters. Done means an optional route such as /users/[i:id?] works and the requested router access is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.