Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Document redirectTo() on fixture page and page data builders

Đang mở Phù hợp với người mới
#244 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
68/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
markdown, php
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu từ trang fixtures trong content/4.api/, cạnh phần tài liệu hiện có về $cwa->redirect(), và đọc ví dụ redirectTo() cùng danh sách hành vi trong issue. Hãy xác nhận hành vi dựa trên PR bundle API được liên kết (#468) thay vì đoán. Hoàn thành khi trang giải thích redirectTo() khác redirect() ở điểm nào, các đích hợp lệ, các trường hợp lỗi, quy tắc --append và thay đổi đối với generate-fixtures.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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".
Ngôn ngữ chính
Vue
Star
0
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của components-web-app/docs

Tất cả issue của components-web-app/docs

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.