Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Template.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  public function execute()
17  {
18  /* @var $widgetInstance \Magento\Widget\Model\Widget\Instance */
19  $widgetInstance = $this->_initWidgetInstance();
20  $block = $this->getRequest()->getParam('block');
21  $selected = $this->getRequest()->getParam('selected', null);
22  $templateChooser = $this->_view->getLayout()->createBlock(
23  \Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Template::class
24  )->setSelected(
25  $selected
26  )->setWidgetTemplates(
27  $widgetInstance->getWidgetSupportedTemplatesByContainer($block)
28  );
29  $this->setBody($templateChooser->toHtml());
30  }
31 }
$block
Definition: block.php:8