コード例 #1
0
 /**
  * Return the file path to current layout, try to create it if not exists.
  *
  * @param Layout $layout
  *
  * @return string the file path
  *
  * @throws RendererException
  */
 protected function getLayoutFile(Layout $layout)
 {
     $layoutfile = $layout->getPath();
     if (null === $layoutfile && 0 < count($this->_includeExtensions)) {
         $ext = reset($this->_includeExtensions);
         $layoutfile = StringUtils::toPath($layout->getLabel(), array('extension' => $ext));
         $layout->setPath($layoutfile);
     }
     return $layoutfile;
 }
コード例 #2
0
ファイル: Renderer.php プロジェクト: gobjila/BackBee
 /**
  * Return the file path to current layout, try to create it if not exists.
  *
  * @param Layout $layout
  *
  * @return string the file path
  *
  * @throws RendererException
  */
 protected function getLayoutFile(Layout $layout)
 {
     $layoutfile = $layout->getPath();
     if (null === $layoutfile && 0 < $this->manageableExt->count()) {
         $adapter = null;
         if (null !== $this->defaultAdapter && null !== ($adapter = $this->rendererAdapters->get($this->defaultAdapter))) {
             $extensions = $adapter->getManagedFileExtensions();
         } else {
             $extensions = $this->manageableExt->keys();
         }
         if (0 === count($extensions)) {
             throw new RendererException('Declared adapter(s) (count:' . $this->rendererAdapters->count() . ') is/are not able to manage ' . 'any file extensions at moment.');
         }
         $layoutfile = StringUtils::toPath($layout->getLabel(), array('extension' => reset($extensions)));
         $layout->setPath($layoutfile);
     }
     return $layoutfile;
 }