Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / templates / Block.html.twig
1 /**
2  * @file
3  * Contains \Drupal\{{ module }}\Plugin\Block\{{ class }}.
4  */
5
6 namespace Drupal\{{ module }}\Plugin\Block;
7
8 use Drupal\Core\Block\BlockBase;
9 {% if configurable %}
10 use Drupal\Core\Form\FormStateInterface;
11 {% endif %}
12
13 /**
14  * Provides the {{ class }} block.
15  *
16  * @Block(
17  *   id = "{{ module }}_{{ block_id }}",
18  *   admin_label = @Translation("{{ block_label }}")
19  * )
20  */
21 class {{ class }} extends BlockBase {
22
23   /**
24    * {@inheritdoc}
25    */
26   public function build() {
27     /**
28      * @FIXME
29      * hook_block_view() has been removed in Drupal 8. You should move your
30      * block's view logic into this method and delete {{ module }}_block_view()
31      * as soon as possible!
32      */
33     return {{ module }}_block_view('{{ block_id }}');
34   }
35
36   {% if configurable %}
37   /**
38    * {@inheritdoc}
39    */
40   public function blockForm($form, FormStateInterface $form_state) {
41     /**
42      * @FIXME
43      * hook_block_configure() is gone in Drupal 8. You should move your block's
44      * configuration logic into this method and delete {{ module }}_block_configure()
45      * as soon as possible!
46      */
47     return {{ module }}_block_configure('{{ block_id }}');
48   }
49
50   /**
51    * {@inheritdoc}
52    */
53   public function blockSubmit($form, FormStateInterface $form_state) {
54     /**
55      * @FIXME
56      * hook_block_save() is gone in Drupal 8. You should move your block's save
57      * logic into this method and delete {{ module }}_block_save() as soon as
58      * possible!
59      */
60     return {{ module }}_block_save('{{ block_id }}', $form_state->getValues());
61   }
62   {% endif %}
63
64 }