예제 #1
0
파일: Router.php 프로젝트: hubs/yuncms
 public function _initialize()
 {
     if (C('router', SITE_HOST)) {
         // 加载基于域名的URL 路由配置
         $this->_config = C('router', SITE_HOST);
         define('SUB_DOMAIN', strtolower(substr(SITE_HOST, 0, strpos(SITE_HOST, '.'))));
         // 二级域名定义
         $this->params = array('action' => 2, 'controller' => 1);
     } else {
         // 使用默认路由配置
         $this->_config = C('router', 'default');
     }
     $full_url = Base_Request::get_host_info() . Base_Request::get_request_uri();
     $this->_pathinfo = $_pathinfo = trim(str_replace(Base_Request::get_base_url(true), '', $full_url), '/');
 }
예제 #2
0
파일: Router.php 프로젝트: hubs/yuncms
 /**
  * (non-PHPdoc)
  *
  * @see Base_Router::_initialize()
  */
 public function _initialize()
 {
     $this->_config = C('router', 'api');
     $full_url = Base_Request::get_host_info() . Base_Request::get_request_uri();
     $this->_pathinfo = $_pathinfo = trim(str_replace(Base_Request::get_base_url(true), '', $full_url), '/');
 }