Skip to content

Update shipped module templates to use the new response redirect API #541

Closed

Description

@armanist

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

Activity

  1. added this to the 3.1.0 milestone on Jun 18, 2026
  2. added
    templatesShipped templates and scaffolding
    httpHTTP transport, redirects, and request/response behavior
    on Jun 20, 2026
  3. modified the milestones: 3.1.0, 3.2.0, 3.1.1 on Oct 23, 2026
  4. self-assigned this
    on Oct 27, 2026
  5. added 3 commits that reference this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomershttpHTTP transport, redirects, and request/response behaviortemplatesShipped templates and scaffolding

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions