当前位置: 首页>>代码示例>>PHP>>正文


PHP helper::setModelFile方法代码示例

本文整理汇总了PHP中helper::setModelFile方法的典型用法代码示例。如果您正苦于以下问题:PHP helper::setModelFile方法的具体用法?PHP helper::setModelFile怎么用?PHP helper::setModelFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在helper的用法示例。


在下文中一共展示了helper::setModelFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadModel

 /**
  * Load the model file of one module.
  * 
  * @param   string      $methodName    The method name, if empty, use current module's name.
  * @access  public
  * @return  object|bool If no model file, return false. Else return the model object.
  */
 protected function loadModel($moduleName)
 {
     $modelFile = \helper::setModelFile($moduleName);
     /* If no model file, try load config. */
     if (!\helper::import($modelFile)) {
         $this->app->loadConfig($moduleName, false);
         $this->app->loadLang($moduleName);
         $this->dao = new dao();
         return false;
     }
     $modelClass = class_exists('ext' . $moduleName . 'model') ? 'ext' . $moduleName . 'model' : $moduleName . 'model';
     $modelClass = '\\' . $modelClass;
     if (!class_exists($modelClass)) {
         $this->app->triggerError(" The model {$modelClass} not found", __FILE__, __LINE__, $exit = true);
     }
     $this->{$moduleName} = new $modelClass();
     $this->dao = $this->{$moduleName}->dao;
     return $this->{$moduleName};
 }
开发者ID:wsyandy,项目名称:zentao-rest-api,代码行数:26,代码来源:Resource.php

示例2: loadModel

 /**
  * Load the model of one module. After loaded, can use $this->modulename to visit the model object.
  * 
  * @param   string  $moduleName
  * @access  public
  * @return  object|bool  the model object or false if model file not exists.
  */
 public function loadModel($moduleName)
 {
     if (empty($moduleName)) {
         return false;
     }
     $modelFile = helper::setModelFile($moduleName);
     if (!helper::import($modelFile)) {
         return false;
     }
     $modelClass = class_exists('ext' . $moduleName . 'model') ? 'ext' . $moduleName . 'model' : $moduleName . 'model';
     if (!class_exists($modelClass)) {
         $this->app->triggerError(" The model {$modelClass} not found", __FILE__, __LINE__, $exit = true);
     }
     $this->{$moduleName} = new $modelClass();
     return $this->{$moduleName};
 }
开发者ID:dyp8848,项目名称:chanzhieps,代码行数:23,代码来源:model.class.php

示例3: loadCommon

 /**
  * Load the common module
  *
  *  The common module is a special module, which can be used to do some common things. For examle:
  *  start session, check priviledge and so on.
  *  This method should called manually in the router file(www/index.php) after the $lang, $config, $dbh loadde.
  *
  * @access public
  * @return object|bool  the common control object or false if not exits.
  */
 public function loadCommon()
 {
     $this->setModuleName('common');
     $commonModelFile = helper::setModelFile('common');
     if (!file_exists($commonModelFile)) {
         $commonModelFile = helper::setModelFile('common', 'sys');
     }
     helper::import($commonModelFile);
     if (class_exists('extcommonModel')) {
         return new extcommonModel();
     } elseif (class_exists('commonModel')) {
         return new commonModel();
     } else {
         return false;
     }
 }
开发者ID:leowh,项目名称:colla,代码行数:26,代码来源:router.class.php

示例4: loadModel

 /**
  * Load the model file of one module.
  * 
  * @param   string      $methodName    The method name, if empty, use current module's name.
  * @access  public
  * @return  object|bool If no model file, return false. Else return the model object.
  */
 public function loadModel($moduleName = '')
 {
     if (empty($moduleName)) {
         $moduleName = $this->moduleName;
     }
     $modelFile = helper::setModelFile($moduleName);
     /* If no model file, try load config. */
     if (!helper::import($modelFile)) {
         $this->app->loadConfig($moduleName, false);
         $this->app->loadLang($moduleName);
         $this->dao = new dao();
         return false;
     }
     $modelClass = class_exists('ext' . $moduleName . 'model') ? 'ext' . $moduleName . 'model' : $moduleName . 'model';
     if (!class_exists($modelClass)) {
         $this->app->error(" The model {$modelClass} not found", __FILE__, __LINE__, $exit = true);
     }
     $this->{$moduleName} = new $modelClass();
     $this->dao = $this->{$moduleName}->dao;
     return $this->{$moduleName};
 }
开发者ID:laiello,项目名称:zentaoms,代码行数:28,代码来源:control.class.php


注:本文中的helper::setModelFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。