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

Update shipped module templates to use the new response redirect API

Open
#541 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

http templates

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:

  • DemoWeb
  • Toolkit

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/DemoWeb
  • src/Module/Templates/Toolkit

Depends on:

  • #540
Dominant language
PHP
Stars
36
Forks
22
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 quantum-php/framework

All issues in quantum-php/framework

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.