Example #1
0
 /**
  * Returns a html with all blocks for the area.
  *
  * @param $area
  * @return mixed
  */
 public function getBlocks($area)
 {
     $areaBlocks = $this->getDesktopBlockByArea($area);
     if (is_null($areaBlocks)) {
         return;
     }
     return $areaBlocks->map(function (Block $block, $key) {
         // each block
         $html = new Html($block);
         return $html->getDesktopHtml();
     })->implode('');
 }
Example #2
0
 /**
  * Return a html block list.
  *
  * @return string
  */
 public function getMobileBlocks()
 {
     $allBlocks = $this->getAllBlocks();
     return $allBlocks->map(function ($area, $key) {
         // each area
         return $area->map(function (Block $block, $key) {
             // each block
             if (is_null($block) || $block->active == false || $block->mobile_view == false) {
                 return '';
             }
             // generate html
             $html = new Html($block);
             return $html->getMobileHtml();
         })->implode('');
     })->implode('');
 }