X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Ftemplates%2FBlock.html.twig;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Ftemplates%2FBlock.html.twig;h=5b8da6e46184defcf70f68aa9d9cfe3010a7b818;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/templates/Block.html.twig b/web/modules/contrib/drupalmoduleupgrader/templates/Block.html.twig new file mode 100644 index 000000000..5b8da6e46 --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/templates/Block.html.twig @@ -0,0 +1,64 @@ +/** + * @file + * Contains \Drupal\{{ module }}\Plugin\Block\{{ class }}. + */ + +namespace Drupal\{{ module }}\Plugin\Block; + +use Drupal\Core\Block\BlockBase; +{% if configurable %} +use Drupal\Core\Form\FormStateInterface; +{% endif %} + +/** + * Provides the {{ class }} block. + * + * @Block( + * id = "{{ module }}_{{ block_id }}", + * admin_label = @Translation("{{ block_label }}") + * ) + */ +class {{ class }} extends BlockBase { + + /** + * {@inheritdoc} + */ + public function build() { + /** + * @FIXME + * hook_block_view() has been removed in Drupal 8. You should move your + * block's view logic into this method and delete {{ module }}_block_view() + * as soon as possible! + */ + return {{ module }}_block_view('{{ block_id }}'); + } + + {% if configurable %} + /** + * {@inheritdoc} + */ + public function blockForm($form, FormStateInterface $form_state) { + /** + * @FIXME + * hook_block_configure() is gone in Drupal 8. You should move your block's + * configuration logic into this method and delete {{ module }}_block_configure() + * as soon as possible! + */ + return {{ module }}_block_configure('{{ block_id }}'); + } + + /** + * {@inheritdoc} + */ + public function blockSubmit($form, FormStateInterface $form_state) { + /** + * @FIXME + * hook_block_save() is gone in Drupal 8. You should move your block's save + * logic into this method and delete {{ module }}_block_save() as soon as + * possible! + */ + return {{ module }}_block_save('{{ block_id }}', $form_state->getValues()); + } + {% endif %} + +}