我定下了1美元路线[404美元_过度使用]=城市/巫师。
现在,我的城市控制人
市级 页: 1
function __construct() {
parent::__construct();
}
function switch_site( ) {
$this->load->helper( url ); // load the helper first
$city = $this->uri->segment(1);
$segment_cnt = 1;
$valid_url = ;
switch( $city ) {
case pune :
$segments = $this->uri->segment_array(2);
foreach($segments as $value) {
if($segment_cnt > 1) {
$valid_url .= $this->uri->slash_segment($segment_cnt);
}
$segment_cnt++;
}
$this->config->set_item( cityid ,1);
$this->config->set_item( cityname , pune );
echo APPPATH. controllers/ .$valid_url;
include_once(APPPATH. controllers/ .$valid_url);
break;
case mumbai :
$segments = $this->uri->segment_array(2);
foreach($segments as $value) {
if($segment_cnt > 1) {
$valid_url .= $this->uri->slash_segment($segment_cnt);
}
$segment_cnt++;
}
$this->config->set_item( cityid ,2);
$this->config->set_item( cityname , mumbai );
include_once(APPPATH. controllers/ .$valid_url);
break;
default:
}
}
}
我们现在如何通过正确的航程来规范航道