File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
templates/Plugin/Views/_field
tests/functional/Generator/Plugin/Views/_field
_n_deps/_n_config/src/Plugin/views/field
_w_deps/_w_config/src/Plugin/views/field Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ namespace Drupal\{{ machine_name }}\Plugin\views\field;
77
88{% apply sort_namespaces % }
99use Drupal\Component\Render\MarkupInterface ;
10+ use Drupal\views\Attribute\ViewsField ;
1011use Drupal\views\Plugin\views\field\FieldPluginBase ;
1112use Drupal\views\ResultRow ;
1213 {% if configurable % }
@@ -21,8 +22,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
2122/**
2223 * Provides {{ plugin_label }} field handler.
2324 *
24- * @ViewsField("{{ plugin_id }}")
25- *
2625 * @DCG
2726 * The plugin needs to be assigned to a specific table column through
2827 * hook_views_data() or hook_views_data_alter().
@@ -37,6 +36,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
3736 * }
3837 * @endcode
3938 */
39+ # [ViewsField('{{ plugin_id }}')]
4040final class {{ class }} extends FieldPluginBase {
4141
4242{% if services % }
Original file line number Diff line number Diff line change 55namespace Drupal \foo \Plugin \views \field ;
66
77use Drupal \Component \Render \MarkupInterface ;
8+ use Drupal \views \Attribute \ViewsField ;
89use Drupal \views \Plugin \views \field \FieldPluginBase ;
910use Drupal \views \ResultRow ;
1011
1112/**
1213 * Provides Example field handler.
1314 *
14- * @ViewsField("foo_example")
15- *
1615 * @DCG
1716 * The plugin needs to be assigned to a specific table column through
1817 * hook_views_data() or hook_views_data_alter().
2726 * }
2827 * @endcode
2928 */
29+ #[ViewsField('foo_example ' )]
3030final class Example extends FieldPluginBase {
3131
3232 /**
Original file line number Diff line number Diff line change 77use Drupal \Component \Render \MarkupInterface ;
88use Drupal \Core \Entity \EntityTypeManagerInterface ;
99use Drupal \Core \Form \FormStateInterface ;
10+ use Drupal \views \Attribute \ViewsField ;
1011use Drupal \views \Plugin \views \field \FieldPluginBase ;
1112use Drupal \views \ResultRow ;
1213use Symfony \Component \DependencyInjection \ContainerInterface ;
1314
1415/**
1516 * Provides Example field handler.
1617 *
17- * @ViewsField("foo_example")
18- *
1918 * @DCG
2019 * The plugin needs to be assigned to a specific table column through
2120 * hook_views_data() or hook_views_data_alter().
3029 * }
3130 * @endcode
3231 */
32+ #[ViewsField('foo_example ' )]
3333final class Example extends FieldPluginBase {
3434
3535 /**
You can’t perform that action at this time.
0 commit comments