示例#1
0
文件: Document.php 项目: nabble/ajde
 /**
  * @return Ajde_Layout
  */
 public function setLayout(Ajde_Layout $layout)
 {
     if (!$layout instanceof Ajde_Layout) {
         $layout = new Ajde_Layout($layout);
     }
     $layout->setDocument($this);
     return $this->set('layout', $layout);
 }
示例#2
0
 public static function getLinkTemplateFilename($type, $format = 'null')
 {
     if (Ajde::app()->getDocument()->hasLayout()) {
         $layout = Ajde::app()->getDocument()->getLayout();
     } else {
         $layout = new Ajde_Layout(Config::get("layout"));
     }
     $format = issetor($format, 'html');
     return LAYOUT_DIR . $layout->getName() . '/link/' . $type . '.' . $format . '.php';
 }
示例#3
0
文件: Resource.php 项目: nabble/ajde
 public static function getLinkTemplateFilename($type, $format = 'null')
 {
     if (Ajde::app()->getDocument()->hasLayout()) {
         $layout = Ajde::app()->getDocument()->getLayout();
     } else {
         $layout = new Ajde_Layout(config('layout.frontend'));
     }
     $format = issetor($format, 'html');
     $dirPrefixPatterns = [APP_DIR, CORE_DIR];
     foreach ($dirPrefixPatterns as $dirPrefixPattern) {
         $prefixedLayout = $dirPrefixPattern . LAYOUT_DIR;
         if (self::exist($prefixedLayout . $layout->getName() . '/link/' . $type . '.' . $format . '.php')) {
             return $prefixedLayout . $layout->getName() . '/link/' . $type . '.' . $format . '.php';
         }
     }
     return false;
 }
示例#4
0
 public static function postProcess(Ajde_Layout $layout)
 {
     $layout->setContents(self::minifyHtml($layout->getContents()));
 }
示例#5
0
 public static function postProcess(Ajde_Layout $layout)
 {
     $debugger = Ajde_Controller::fromRoute(new Ajde_Core_Route('_core/debugger:view.html'))->invoke();
     $layout->setContents($layout->getContents() . $debugger);
 }
示例#6
0
文件: Less.php 项目: nabble/ajde
 public static function postProcess(Ajde_Layout $layout)
 {
     $layout->setContents(self::lessifyCss($layout->getContents()));
 }
示例#7
0
 /**
  * @return Ajde_Layout
  */
 public function setLayout(Ajde_Layout $layout)
 {
     $layout->setDocument($this);
     return $this->set("layout", $layout);
 }