Ejemplo n.º 1
0
 /**
  * Add layout block
  *
  * @param  LayoutBlockInterface $layoutBlock
  * @return $this
  */
 public function addLayoutBlock(LayoutBlockInterface $layoutBlock)
 {
     $layoutBlock->setPage($this);
     $this->layoutBlock->add($layoutBlock);
     return $this;
 }
 /**
  * @param LayoutBlockInterface $layoutBlock
  * @return mixed
  */
 public function renderContentTypeName(LayoutBlockInterface $layoutBlock)
 {
     if ($layoutBlock->getObjectId()) {
         $contentItem = $layoutBlock->getContent();
     } else {
         $classType = $layoutBlock->getClassType();
         $contentItem = new $classType();
     }
     if (method_exists($contentItem, 'getContentTypeName')) {
         $name = $contentItem->getContentTypeName();
     } else {
         $name = get_class($contentItem);
     }
     return $this->getService('translator')->trans($name);
 }