function ExampleMeatballSandwich::order

Same name and namespace in other branches
  1. 4.0.x modules/plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php \Drupal\plugin_type_example\Plugin\Sandwich\ExampleMeatballSandwich::order()

Overrides SandwichBase::order

File

modules/plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php, line 88

Class

ExampleMeatballSandwich
Provides a meatball sandwich.

Namespace

Drupal\plugin_type_example\Plugin\Sandwich

Code

public function order(array $extras) {
  $ingredients = [
    'meatballs',
    'irresistible marinara sauce',
  ];
  $sandwich = array_merge($ingredients, $extras);
  return 'You ordered an ' . implode(', ', $sandwich) . ' sandwich. Enjoy!';
}