function ExampleMeatballSandwich::order

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

Overrides SandwichBase::order

File

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!';
}