/** * 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(''); }
/** * 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(''); }