Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Item.php
Go to the documentation of this file.
1 <?php
7 
16 {
20  protected $_massaction = null;
21 
28  public function setMassaction($massaction)
29  {
30  $this->_massaction = $massaction;
31  return $this;
32  }
33 
39  public function getMassaction()
40  {
41  return $this->_massaction;
42  }
43 
52  {
53  if (is_string($block)) {
54  $block = $this->getLayout()->createBlock($block);
55  } elseif (is_array($block)) {
57  } elseif (!$block instanceof \Magento\Framework\View\Element\AbstractBlock) {
58  throw new \Magento\Framework\Exception\LocalizedException(__('Unknown block type'));
59  }
60 
61  $this->setChild('additional_action', $block);
62  return $this;
63  }
64 
69  protected function _createFromConfig(array $config)
70  {
71  $type = isset($config['type']) ? $config['type'] : 'default';
72  switch ($type) {
73  default:
74  $blockClass = \Magento\Backend\Block\Widget\Grid\Massaction\Item\Additional\DefaultAdditional::class;
75  break;
76  }
77 
78  $block = $this->getLayout()->createBlock($blockClass);
79  $block->createFromConfiguration(isset($config['type']) ? $config['config'] : $config);
80  return $block;
81  }
82 
88  public function getAdditionalActionBlock()
89  {
90  return $this->getChildBlock('additional_action');
91  }
92 
98  public function getAdditionalActionBlockHtml()
99  {
100  return $this->getChildHtml('additional_action');
101  }
102 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$config
Definition: fraud_order.php:17
__()
Definition: __.php:13
$block
Definition: block.php:8
$type
Definition: item.phtml:13