コード例 #1
0
 /**
  * {@inheritdoc}
  */
 protected function _toHtml()
 {
     $item = $this->getButtonItem();
     $context = $this->getContext();
     if ($item && $context && $context->canRender($item)) {
         $data = $item->getData();
         $blockClassName = isset($data['class_name']) ? $data['class_name'] : null;
         $buttonName = $this->getContext()->getNameInLayout() . '-' . $item->getId() . '-button';
         $block = $this->createButton($buttonName, $blockClassName);
         $block->setData($data);
         return $block->toHtml();
     }
     return parent::_toHtml();
 }