hook_entity_operation(\Drupal\Core\Entity\EntityInterface $entity)
Declares entity operations.
\Drupal\Core\Entity\EntityInterface $entity: The entity on which the linked operations will be performed.
array An operations array as returned by EntityListBuilderInterface::getOperations().
\Drupal\Core\Entity\EntityListBuilderInterface::getOperations()
function hook_entity_operation(\Drupal\Core\Entity\EntityInterface $entity) { $operations = array(); $operations['translate'] = array( 'title' => t('Translate'), 'url' => \Drupal\Core\Url::fromRoute('foo_module.entity.translate'), 'weight' => 50, ); return $operations; }
© 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!entity.api.php/function/hook_entity_operation/8.1.x