示例#1
0
 public function getPlaceHolderSet()
 {
     if ($this->placeHolderSet) {
         return $this->placeHolderSet;
     }
     parent::getPlaceHolderSet();
     $this->createMissingPlaceHolders();
     return $this->placeHolderSet;
 }
示例#2
0
 /**
  * Creates placeholder response objects with collected block responses.
  * 
  * @return PlaceHolderResponse[]
  */
 protected function createPlaceResponses()
 {
     $placeResponses = array();
     $placeHolders = $this->pageRequest->getPlaceHolderSet();
     foreach ($placeHolders->getFinalPlaceHolders() as $name => $placeHolder) {
         $placeResponses[$name] = $this->createPlaceResponse($placeHolder);
     }
     $this->iterateBlocks(function (Block $block, BlockController $blockController) use(&$placeResponses) {
         /* @var $placeResponses PlaceHolderResponse[] */
         $response = $blockController->getResponse();
         $placeName = $block->getPlaceHolder()->getName();
         if (!isset($placeResponses[$placeName])) {
             throw new \LogicException("Logic problem – final place holder by name [{$placeName}] is not found.");
         }
         $placeResponses[$placeName]->output($response);
     });
     return $placeResponses;
 }