示例#1
0
 /**
  * Before rendering html, but after trying to load cache
  *
  * @return void
  */
 protected function _beforeToHtml()
 {
     if ($this->getParentBlock() && ($order = $this->getOrder())) {
         $this->setEntity($order);
     }
     parent::_beforeToHtml();
 }
示例#2
0
文件: Search.php 项目: aiesh/magento2
 /**
  * Prepare search grid
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     $this->getChildBlock('grid')->setIndex($this->getIndex())->setFirstShow($this->getFirstShow());
     return parent::_beforeToHtml();
 }
示例#3
0
文件: Grid.php 项目: opexsw/magento2
 /**
  * Initialize grid before rendering
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     $this->_prepareGrid();
     return parent::_beforeToHtml();
 }
示例#4
0
 /**
  * Collect, sort and set template options
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     $groupedOptions = [];
     foreach ($this->_getDefaultTemplatesAsOptionsArray() as $option) {
         $groupedOptions[$option['group']][] = $option;
     }
     ksort($groupedOptions);
     $this->setData('template_options', $groupedOptions);
     return parent::_beforeToHtml();
 }
示例#5
0
 /**
  * This method is called before rendering HTML
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     $this->_prepareForm();
     $this->_initFormValues();
     return parent::_beforeToHtml();
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 protected function _beforeToHtml()
 {
     if ($activeTab = $this->getRequest()->getParam('active_tab')) {
         $this->setActiveTab($activeTab);
     } elseif ($activeTabId = $this->_authSession->getActiveTabId()) {
         $this->_setActiveTab($activeTabId);
     }
     $_new = [];
     foreach ($this->_tabs as $key => $tab) {
         foreach ($this->_tabs as $k => $t) {
             if ($t->getAfter() == $key) {
                 $_new[$key] = $tab;
                 $_new[$k] = $t;
             } else {
                 if (!$tab->getAfter() || !in_array($tab->getAfter(), array_keys($this->_tabs))) {
                     $_new[$key] = $tab;
                 }
             }
         }
     }
     $this->_tabs = $_new;
     unset($_new);
     $this->assign('tabs', $this->_tabs);
     return parent::_beforeToHtml();
 }