Newer
Older
<?php
/**
* @file
* Contains \Drupal\entity_test\Plugin\Derivative\EntityTestLocalTasks.
*/
namespace Drupal\entity_test\Plugin\Derivative;
Dries Buytaert
committed
use Drupal\Component\Plugin\Derivative\DeriverBase;
/**
* Defines the local tasks for all the entity_test entities.
*/
Dries Buytaert
committed
class EntityTestLocalTasks extends DeriverBase {
/**
* {@inheritdoc}
*/
Alex Pott
committed
public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives = array();
$types = entity_test_entity_types();
foreach($types as $entity_type) {
$this->derivatives[$entity_type] = array();
Angie Byron
committed
$this->derivatives[$entity_type]['base_route'] = "entity_test.edit_$entity_type";
$this->derivatives[$entity_type]['route_name'] = "entity_test.edit_$entity_type";
$this->derivatives[$entity_type]['title'] = 'Edit';
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}
}