function EntityController::editTitle
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::editTitle()
- 8.9.x core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::editTitle()
- 10 core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::editTitle()
Provides a generic edit title callback.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.
\Drupal\Core\Entity\EntityInterface $_entity: (optional) An entity, passed in directly from the request attributes.
Return value
string|null The title for the entity edit page, if an entity was found.
File
-
core/
lib/ Drupal/ Core/ Entity/ Controller/ EntityController.php, line 281
Class
- EntityController
- Provides the add-page and title callbacks for entities.
Namespace
Drupal\Core\Entity\ControllerCode
public function editTitle(RouteMatchInterface $route_match, ?EntityInterface $_entity = NULL) {
if ($entity = $this->doGetEntity($route_match, $_entity)) {
return $this->t('Edit %label', [
'%label' => $entity->label(),
]);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.