3 * Contains \Drupal\{{ module }}\Plugin\Block\{{ class }}.
6 namespace Drupal\{{ module }}\Plugin\Block;
8 use Drupal\Core\Block\BlockBase;
10 use Drupal\Core\Form\FormStateInterface;
14 * Provides the {{ class }} block.
17 * id = "{{ module }}_{{ block_id }}",
18 * admin_label = @Translation("{{ block_label }}")
21 class {{ class }} extends BlockBase {
26 public function build() {
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!
33 return {{ module }}_block_view('{{ block_id }}');
40 public function blockForm($form, FormStateInterface $form_state) {
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!
47 return {{ module }}_block_configure('{{ block_id }}');
53 public function blockSubmit($form, FormStateInterface $form_state) {
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
60 return {{ module }}_block_save('{{ block_id }}', $form_state->getValues());