Ejemplo n.º 1
0
 public function __construct()
 {
     // 车源类型
     $this->source_type = array("dealer" => array("bg" => "green-bg", "name" => "优质商家车源"), "odealer" => array("bg" => "violet-bg", "name" => "普通商家车源"), "cpo" => array("bg" => "orange-bg", "name" => "厂商认证二手车"), "personal" => array("bg" => "blue-bg", "name" => "个人车源"));
     parent::__construct($this);
     $this->_view->setResourcePath($this->static_url);
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     //		$this->uploadPath = "D:/xampp/htdocs/pahaoche/gongpingjia/static/uploads/car/";
     $this->uploadPath = "/wwwroot/gongpingjiaPHP/static/uploads/car/";
     parent::__construct($this);
     $this->_view->setResourcePath($this->static_url);
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     parent::__construct($this);
     try {
         $this->setCache(XF_Cache_Memcache::getInstance());
     } catch (XF_Exception $e) {
     }
     parent::__construct($this);
     $this->_view->setResourcePath($this->static_url);
 }
Ejemplo n.º 4
0
 /**
  * 转发控制器
  * @param XF_Controller_Request_Abstract $request
  * @param bool $runRouter 重新运行路由解析 默认为true
  * @throws XF_Controller_Exception
  */
 private function _dispatch(XF_Controller_Request_Abstract $request = null, $runRouter = true)
 {
     $this->_dispath_count++;
     if ($request != null) {
         $this->_request = $request;
     }
     if ($this->_dispath_count == 1) {
         $this->_plugin_manage->routeStartup($this->_request);
         $this->_router->run();
         $this->_plugin_manage->routeShutdown($this->_request);
     } elseif ($this->_dispath_count >= 5) {
         XF_Functions::writeErrLog('URI:' . $this->_request->getRequestUrl() . ' - loop forever dispatch controller');
         throw new XF_Exception('loop forever dispatch controller');
     } else {
         if ($runRouter == true) {
             $this->_router->run();
         }
     }
     //没有找到正确的模块
     if ($this->_request->getModule() == 'unknown') {
         throw new XF_Exception('404 Not found!', 404);
     }
     //加载控制器
     $this->getModuleDir();
     $controllerName = NULL;
     if (strtolower($this->_request->getModule()) != 'default') {
         $controllerName = ucfirst($this->_request->getModule()) . '_';
     }
     $this->_controller_dir = $this->_module_dir . '/controllers';
     $controllerFile = $this->_controller_dir . '/' . ucfirst($this->_request->getController()) . 'Controller.php';
     if (is_file($controllerFile)) {
         require_once $controllerFile;
         $controllerName .= ucfirst($this->_request->getController()) . 'Controller';
         if (class_exists($controllerName, FALSE)) {
             $this->_plugin_manage->preDispatch($this->_request);
             $this->_controller_instance = new $controllerName();
             $this->_plugin_manage->postDispatch($this->_request);
         }
     }
     if ($this->_controller_instance == null) {
         throw new XF_Exception('404 Not found!', 404);
     } elseif ($this->_controller_instance instanceof XF_Controller_Interface) {
         $this->_controller_instance->doAction();
     } else {
         throw new XF_Exception('404 Not found!', 404);
     }
 }
Ejemplo n.º 5
0
 public function __construct()
 {
     parent::__construct($this);
 }