function entity_test_operation_entity_operation

Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test_operation/entity_test_operation.module \entity_test_operation_entity_operation()
  2. 8.9.x core/modules/system/tests/modules/entity_test_operation/entity_test_operation.module \entity_test_operation_entity_operation()
  3. 11.x core/modules/system/tests/modules/entity_test_operation/entity_test_operation.module \entity_test_operation_entity_operation()

Implements hook_entity_operation().

File

core/modules/system/tests/modules/entity_test_operation/entity_test_operation.module, line 14

Code

function entity_test_operation_entity_operation(EntityInterface $entity) {
    return [
        'test' => [
            'title' => t('Front page'),
            'url' => Url::fromRoute('<front>'),
            'weight' => 0,
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.