You are here

function webform_node_entity_operation in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_node/webform_node.module \webform_node_entity_operation()

Implements hook_entity_operation().

File

modules/webform_node/webform_node.module, line 35
Provides a webform content type which allows webforms to be integrated into a website as nodes.

Code

function webform_node_entity_operation(EntityInterface $entity) {
  $operations = [];
  if ($entity instanceof WebformInterface && $entity
    ->access('update')) {
    $operations['references'] = [
      'title' => t('References'),
      'url' => $entity
        ->toUrl('references'),
      'weight' => 40,
    ];
  }
  return $operations;
}