@@ -40,12 +40,18 @@ class {{class_name}} extends BlockBase {% if services is not empty %}implements
40
40
* The plugin_id for the plugin instance.
41
41
* @param string $plugin_definition
42
42
* The plugin implementation definition.
43
+ {% if services is not empty %}
44
+ {% for service in services %}
45
+ * @param \{{ service .class }} ${{service .machine_name }}
46
+ * The {{service .short }} definition.
47
+ {% endfor %}
48
+ {% endif %}
43
49
*/
44
50
public function __construct(
45
51
array $configuration,
46
52
$plugin_id,
47
53
$plugin_definition,
48
- {{ servicesAsParameters(services )| join (' , \n\t ' ) }}
54
+ {{ servicesAsParameters(services )| join (' ,\n ' ) }}
49
55
) {
50
56
parent::__construct($configuration, $plugin_id, $plugin_definition);
51
57
{{ serviceClassInitialization(services ) }}
@@ -54,6 +60,7 @@ class {{class_name}} extends BlockBase {% if services is not empty %}implements
54
60
{% endblock %}
55
61
{% block class_create %}
56
62
{% if services is not empty %}
63
+
57
64
/**
58
65
* {@inheritdoc}
59
66
*/
@@ -65,6 +72,7 @@ class {{class_name}} extends BlockBase {% if services is not empty %}implements
65
72
{{ serviceClassInjection(services ) }}
66
73
);
67
74
}
75
+
68
76
{% endif %}
69
77
{% endblock %}
70
78
{% block class_methods %}
@@ -75,9 +83,9 @@ class {{class_name}} extends BlockBase {% if services is not empty %}implements
75
83
public function defaultConfiguration() {
76
84
return [
77
85
{% for input in inputs %}
78
- {% if input .default_value is defined and input .default_value | length %}
86
+ {% if input .default_value is defined and input .default_value | length %}
79
87
'{{ input .name }}' => {{ input .default_value }},
80
- {% endif %}
88
+ {% endif %}
81
89
{% endfor %}
82
90
] + parent::defaultConfiguration();
83
91
}
@@ -91,7 +99,7 @@ class {{class_name}} extends BlockBase {% if services is not empty %}implements
91
99
'#type' => '{{ input .type }}',
92
100
'#title' => $this->t('{{ input .label | escape }}'),
93
101
{% if input .description is defined and input .description is not empty %}
94
- '#description' => $this->t('{{ input .description | e }}'),
102
+ '#description' => $this->t('{{ input .description | e }}'),
95
103
{% endif %}
96
104
{% if input .options is defined and input .options | length %}
97
105
'#options' => {{ input .options }},
@@ -128,7 +136,7 @@ class {{class_name}} extends BlockBase {% if services is not empty %}implements
128
136
public function build() {
129
137
$build = [];
130
138
{% for input in inputs %}
131
- $build['{{plugin_id }}_{{ input .name }}']['#markup'] = '<p >' . $this->configuration['{{ input .name }}']. '</p >';
139
+ $build['{{plugin_id }}_{{ input .name }}']['#markup'] = '<p >' . $this->configuration['{{ input .name }}'] . '</p >';
132
140
{% else %}
133
141
$build['{{plugin_id }}']['#markup'] = 'Implement {{class_name }}.';
134
142
{% endfor %}
0 commit comments