X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fservice%2Ftwig-extension.twig;h=99f5acd9016ea2617ca3dd7506b37506e487936e;hp=39f9902114bfa0102fc7cbd95376acf8f71ad9ab;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.twig index 39f990211..99f5acd90 100644 --- a/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.twig +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/service/twig-extension.twig @@ -2,18 +2,34 @@ namespace Drupal\{{ machine_name }}; +{% if di %} +use Drupal\example\ExampleInterface; + +{% endif %} /** * Twig extension. */ class {{ class }} extends \Twig_Extension { +{% if di %} /** - * {@inheritdoc} + * The example service. + * + * @var \Drupal\example\ExampleInterface + */ + protected $example; + + /** + * Constructs a new {{ class }} instance. + * + * @param \Drupal\example\ExampleInterface $example + * The example service. */ - public function getName() { - return '{{ machine_name }}'; + public function __construct(ExampleInterface $example) { + $this->example = $example; } +{% endif %} /** * {@inheritdoc} */