public function EntityController::deleteTitle

public EntityController::deleteTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL)

Provides a generic delete 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, and set in \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer.

Return value

string The title for the entity delete page.

File

core/lib/Drupal/Core/Entity/Controller/EntityController.php, line 261

Class

EntityController
Provides the add-page and title callbacks for entities.

Namespace

Drupal\Core\Entity\Controller

Code

public function deleteTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) {
  if ($entity = $this->doGetEntity($route_match, $_entity)) {
    return $this->t('Delete %label', ['%label' => $entity->label()]);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Controller!EntityController.php/function/EntityController::deleteTitle/8.1.x