File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
templates/Plugin/Views/_argument-default
tests/functional/Generator/Plugin/Views/_argument_default/src/Plugin/views/argument_default Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ namespace Drupal\{{ machine_name }}\Plugin\views\argument_default;
88{% apply sort_namespaces % }
99use Drupal\Core\Cache\Cache ;
1010use Drupal\Core\Cache\CacheableDependencyInterface ;
11+ use Drupal\Core\StringTranslation\TranslatableMarkup ;
12+ use Drupal\views\Attribute\ViewsArgumentDefault ;
1113 {% if configurable % }
1214use Drupal\Core\Form\FormStateInterface ;
1315 {% endif % }
@@ -20,12 +22,11 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
2022
2123/**
2224 * @todo Add plugin description here.
23- *
24- * @ViewsArgumentDefault(
25- * id = "{{ plugin_id }}",
26- * title = @Translation("{{ plugin_label }}"),
27- * )
2825 */
26+ # [ViewsArgumentDefault(
27+ id : ' {{ plugin_id }}' ,
28+ title : new TranslatableMarkup (' {{ plugin_label }}' ),
29+ )]
2930final class {{ class }} extends ArgumentDefaultPluginBase implements CacheableDependencyInterface {
3031
3132{% if services % }
Original file line number Diff line number Diff line change 88use Drupal \Core \Cache \CacheableDependencyInterface ;
99use Drupal \Core \Form \FormStateInterface ;
1010use Drupal \Core \Routing \RouteMatchInterface ;
11+ use Drupal \Core \StringTranslation \TranslatableMarkup ;
12+ use Drupal \views \Attribute \ViewsArgumentDefault ;
1113use Drupal \views \Plugin \views \argument_default \ArgumentDefaultPluginBase ;
1214use Symfony \Component \DependencyInjection \ContainerInterface ;
1315
1416/**
1517 * @todo Add plugin description here.
16- *
17- * @ViewsArgumentDefault(
18- * id = "foo_example",
19- * title = @Translation("Example"),
20- * )
2118 */
19+ #[ViewsArgumentDefault(
20+ id: 'foo_example ' ,
21+ title: new TranslatableMarkup ('Example ' ),
22+ )]
2223final class Example extends ArgumentDefaultPluginBase implements CacheableDependencyInterface {
2324
2425 /**
You can’t perform that action at this time.
0 commit comments