Beispiel #1
0
 /**
  * 构造函数
  *
  * @param QReflection_Module $module
  * @param string $controller_name
  * @param string $namespace
  */
 function __construct(QReflection_Module $module, $controller_name, $namespace = null)
 {
     $this->_reflection_module = $module;
     $this->_controller_name = $controller_name;
     $this->_namespace = $namespace;
     $controller_name = strtolower($controller_name);
     $dir = rtrim($module->moduleDir(), '/\\') . '/controller';
     if ($namespace) {
         $this->_controller_file_path = "{$dir}/{$namespace}/{$controller_name}_controller.php";
     } else {
         $this->_controller_file_path = "{$dir}/{$controller_name}_controller.php";
     }
 }
 /**
  * 构造函数
  *
  * @param QReflection_Module $module
  * @param string $controller_name
  * @param string $ns
  */
 function __construct(QReflection_Module $module, $controller_name, $ns = null)
 {
     $names = explode('::', $controller_name);
     if (isset($names[1])) {
         $ns = $names[0];
         $controller_name = $names[1];
     }
     $this->_module = $module;
     $this->_controller_name = $controller_name;
     $this->_ns = $ns;
     // 确定控制器对应的文件
     $controller_name = strtolower($controller_name);
     $dir = rtrim($module->moduleDir(), '/\\') . '/controller';
     if ($ns) {
         $this->_controller_file_path = "{$dir}/{$ns}/{$controller_name}_controller.php";
     } else {
         $this->_controller_file_path = "{$dir}/{$controller_name}_controller.php";
     }
     // 确定控制器的类名称
     if (!$module->isDefaultModule()) {
         $class = ucfirst($module->moduleName()) . '_';
     } else {
         $class = '';
     }
     $class .= 'Controller_';
     if ($ns) {
         $class .= ucfirst($ns) . '_';
     }
     $class .= ucfirst($controller_name);
     $this->_controller_class_name = $class;
     // 确定控制器的 UDI
     if ($ns) {
         $udi = $ns . '::' . $controller_name;
     } else {
         $udi = $controller_name;
     }
     if (!$module->isDefaultModule()) {
         $udi .= '@' . $module->moduleName();
     }
     $this->_udi = $udi;
 }
Beispiel #3
0
 function __construct(QReflection_Module $module, $model_name)
 {
     $this->_reflection_module = $module;
     $this->_model_name = $model_name;
     $this->_model_file_path = rtrim($module->moduleDir(), '/\\') . '/model/' . strtolower($model_name) . '.php';
 }