You are here

public function Fruit::display in Plug 7

Displays a fruit.

Return value

string The fruit representation.

Overrides FruitInterface::display

File

modules/plug_example/src/Plugin/fruit/Fruit.php, line 17
Contains Drupal\plug_example\Plugin\fruit\Fruit

Class

Fruit

Namespace

Drupal\plug_example\Plugin\fruit

Code

public function display() {
  $definition = $this
    ->getPluginDefinition();
  if (!empty($definition['slimy'])) {
    return t('Yikes, %name!', array(
      '%name' => $definition['label'],
    ));
  }
  return t('Fruit name: %name', array(
    '%name' => $definition['label'],
  ));
}