Skip to content
Snippets Groups Projects

Issue #3523795: PageVariantInterface::setTitle also accepts \Stringable, update PHPDoc

Open Issue #3523795: PageVariantInterface::setTitle also accepts \Stringable, update PHPDoc
2 unresolved threads
Open dpi requested to merge issue/drupal-3523795:3523795-page-title-typing into 11.x
2 unresolved threads

Closes #3523795

Replaces #12099

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
204 204 protected function prepare(array $main_content, Request $request, RouteMatchInterface $route_match) {
205 205 // Determine the title: use the title provided by the main content if any,
206 206 // otherwise get it from the routing information.
207 $get_title = function (array $main_content) use ($request, $route_match) {
207 $get_title = function (array $main_content) use ($request, $route_match): array|string|\Stringable|null {
208 208 return $main_content['#title'] ?? $this->titleResolver->getTitle($request, $route_match->getRouteObject());
  • dpi
    dpi @dpi started a thread on the diff
  • 255 253 }
    256 254 $page_display
    257 255 ->setMainContent($main_content)
    258 ->setTitle($title)
    259 256 ->addCacheableDependency($event);
    257
    258 $title = $get_title($main_content);
    259 if ($title !== NULL) {
    Please register or sign in to reply
    Loading