Commit 820de233 authored by fietserwin's avatar fietserwin Committed by acrollet

Issue #3048028 by fietserwin: Availability tab lacks title

parent cc985ef0
......@@ -2,6 +2,7 @@ bee.node.availability:
path: '/node/{node}/availability'
defaults:
_controller: '\Drupal\bee\Controller\BeeController::availability'
_title_callback: '\Drupal\bee\Controller\BeeController::availabilityTitle'
requirements:
_bee_availability_access: 'node'
......
......@@ -4,6 +4,7 @@ namespace Drupal\bee\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\node\NodeInterface;
use Drupal\office_hours\OfficeHoursDateHelper;
......@@ -122,4 +123,15 @@ class BeeController extends ControllerBase implements ContainerInjectionInterfac
];
}
/**
* The _title_callback for the page that renders the availability.
*
* @param \Drupal\Core\Entity\EntityInterface $node
*
* @return string
* The page title.
*/
public function availabilityTitle(EntityInterface $node) {
return $this->t('Availability for %label', ['%label' => $node->label()]);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment