Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Document redirectTo() on fixture page and page data builders

クローズ 初心者向け
#244 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
半日
初心者へのやさしさ
68/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
markdown, php
領域
documentation

調査の方向性

content/4.api/ 配下の fixtures ページで、既存の $cwa->redirect() のドキュメントの隣にある内容を開き、issue 内の redirectTo() の例と動作の一覧を読んでください。推測せず、リンクされている API バンドルの PR (#468) で動作を確認してください。ページに、redirectTo() と redirect() の違い、有効なターゲット、失敗するケース、--append のルール、generate-fixtures の変更点が説明されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

API bundle PR: https://github.com/components-web-app/api-components-bundle/pull/468 (fixes components-web-app/api-components-bundle#461)

What to document

The fixture builder has a new method on page and page data builders, redirectTo(routeName). It makes the page's own route redirect to another route, for a URL that is both a page and a redirect. A common case is a home page at / that forwards to a section.

$cwa->page('home', uiComponent: 'Primary', layout: 'main', route: '/', routeName: 'home')
    ->title('Home')
    ->redirectTo(routeName: 'graphs');

$cwa->pageData($pageData, template: 'conference', route: '/events')
    ->redirectTo(routeName: 'cwa-conference');

Points for the fixtures / scaffold page (content/4.api/):

  • How it differs from $cwa->redirect('/old', to: 'about'): redirect() creates a separate route that has no page, while redirectTo() makes the page's own route redirect.
  • The target is a route name: any route in the same load, including a $cwa->redirect() route, or one already in the database. An unknown name fails the load with a message naming the page or page data.
  • A page or page data with no route of its own (a template, withoutRoute(), or no title and no route:) cannot redirect, and the load fails with a message naming redirectTo().
  • doctrine:fixtures:load --append: the redirect is set only on a route the load creates. A page that already exists, or a route whose path is already in use, keeps the redirect it has.
  • generate-fixtures now writes ->redirectTo(routeName: …) for a page or page data whose route redirects. Before this, it dropped the redirect and reported nothing. A target that is not part of the site is listed under "could not be reproduced".
主要言語
TypeScript
スター
0
フォーク
0
平均マージ
1時間 20分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

components-web-app/docs のほかの issue

components-web-app/docs の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。