ExtraModule is a module for Drupal 8 to add some tools for developers
- Download and enable module
- Use your awesome powers
class DefaultController extends ControllerBase{
//...
/**
* helloAction
* @param string $name
*
* @Permission("access content")
*/
public function helloAction($name) {
return "Hello " . $name . "!";
}
//...
}
{# hello.html.twig #}
{% extends "module_name::base.html.twig" %}
{% block hello_wrapper %}
Hellos {{name}}
{% endblock %}
- Template annotation