コード例 #1
0
 private function createFinalResponse(Layout $layout)
 {
     return $this->createResponse('Can\'t create children of ' . $layout->getLabel() . ' layout', 403);
 }
コード例 #2
0
ファイル: Renderer.php プロジェクト: ReissClothing/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;
 }
コード例 #3
0
ファイル: Builder.php プロジェクト: ReissClothing/BackBee
 protected function computeTemplate(Layout $layout, $value)
 {
     if ($value !== null) {
         if (strlen(pathinfo($value, PATHINFO_EXTENSION)) !== 0) {
             $layout->setPath($value);
         } else {
             throw new \Exception('Invalid template name for ' . $layout->getLabel() . ' layout.');
         }
     }
 }
コード例 #4
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;
 }