quantum-php / quantum-php/framework
Update shipped module templates to use the new response redirect API
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Update shipped module templates so redirect behavior uses the new response redirect API introduced by #540 instead of older helper-first redirect patterns.
This should cover generated controllers and middlewares in the shipped templates that currently emit redirect helper usage, primarily DemoWeb and Toolkit.
Why
Current generated module code still uses older redirect helper patterns such as:
redirect(base_url(...) . '...')redirect(get_referrer() ?? base_url())redirectWith(...)
These patterns are repeated across generated controllers and middlewares in the current shipped templates.
Once #540 introduces first-class back-navigation support and a cleaner response-level redirect API, generated scaffolding should reflect that preferred direction instead of continuing to emit older helper-style usage.
Goal
Align shipped module scaffolding with the newer response redirect API so new generated code reflects the preferred redirect style.
Scope
This ticket should update shipped templates that currently emit redirect helper usage, primarily:
DemoWebToolkit
This should cover generated controllers and middlewares where redirect behavior is currently expressed through older helper-first patterns.
Proposed Direction
- replace older helper-first redirect patterns in shipped templates with the new response redirect API introduced by
#540 - use first-class back-navigation support where existing templates currently repeat
get_referrer() ?? base_url()logic - keep the generated redirect code consistent across affected shipped templates
Examples of current patterns to replace include:
redirect(base_url(...) . '...')redirect(get_referrer() ?? base_url())redirectWith(...)
Acceptance Criteria
- shipped module templates no longer emit repeated manual referrer fallback patterns
- generated controllers and middlewares use the preferred response redirect API introduced by
#540 - redirect-related generated code is consistent across affected shipped templates
- generated old-input redirect behavior remains coherent with the updated redirect API
- templates remain functionally equivalent after the redirect API update
Notes
Relevant code includes:
src/Module/Templates/DemoWebsrc/Module/Templates/Toolkit
Depends on:
#540
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read issue #540 first to understand the new response redirect API, then inspect the shipped templates under src/Module/Templates/DemoWeb and src/Module/Templates/Toolkit. Locate generated controllers and middlewares using redirect, redirectWith, or manual get_referrer() fallback patterns. Done means affected templates consistently use the preferred API while preserving old-input redirect behavior and functional equivalence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100