Example #1
0
 /**
  * Here we set an order for children during retrieving their HTML
  *
  * @param string $alias
  * @param bool $useCache
  * @return string
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function getChildHtml($alias = '', $useCache = false)
 {
     $layout = $this->getLayout();
     if ($layout) {
         $name = $this->getNameInLayout();
         foreach ($layout->getChildBlocks($name) as $child) {
             $child->setOrder($this->getOrder());
         }
     }
     return parent::getChildHtml($alias, $useCache);
 }