X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fcontroller.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fcontroller.twig;h=45b839821f47b4d2fb4decfa32a59e292c13d006;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=0000000000000000000000000000000000000000;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/controller.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/controller.twig new file mode 100644 index 000000000..45b839821 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/controller.twig @@ -0,0 +1,60 @@ +dateFormatter = $date_formatter; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('date.formatter') + ); + } + + /** + * Builds the response. + */ + public function build() { + + $build['content'] = [ + '#type' => 'item', + '#title' => $this->t('Content'), + '#markup' => $this->t('Hello world!'), + ]; + + $build['date'] = [ + '#type' => 'item', + '#title' => $this->t('Date'), + '#markup' => $this->dateFormatter->format(REQUEST_TIME), + ]; + + return $build; + } + +}