示例#1
0
 public function __construct($name, $style = 'default', $format = null)
 {
     $this->setName($name);
     $this->setStyle($style);
     $base = LAYOUT_DIR . $this->getName() . DIRECTORY_SEPARATOR;
     $action = $this->getStyle();
     if (!$format) {
         if (Request::isAjax() && $this->exist($base, $action, 'ajax') || Ajde::app()->getDocument()->getFormat() === 'ajax') {
             $format = 'ajax';
         } else {
             if (Ajde::app()->getDocument()->getFormat() === 'crud') {
                 $format = 'crud';
             } else {
                 $format = 'html';
             }
         }
     }
     parent::__construct($base, $action, $format);
 }
示例#2
0
文件: Crud.php 项目: nabble/ajde-core
 private function _hasCustomTemplate()
 {
     $base = $this->_getCustomTemplateBase();
     $action = $this->_getCustomTemplateAction();
     return Template::exist($base, $action) !== false;
 }
示例#3
0
文件: Html.php 项目: nabble/ajde-core
 private function _getTemplateActionDefault(Template $template)
 {
     $actionArray = explode('/', $template->getAction());
     end($actionArray);
     $actionArray[key($actionArray)] = 'default';
     return implode('/', $actionArray);
 }