【发布时间】:2017-08-08 06:47:44
【问题描述】:
在提问之前我已经阅读了documentation。并且还访问了有关相关主题的问题,但我没有帮助。
这是我的锚标记:
<a href="<?= base_url() ?>controller/function/application_title/id">link</a>
例子:
<a href="<?= base_url() ?>app_job/view_single_job /inventory_control_supervisor/1">link</a>
<a href="<?= base_url() ?>app_job/view_single_job /waste_stream_coordinator/3">link</a>
这里是控制器:
public function view_single_job($app_title){
$id = $this->uri->segment(4);
$single_app = $this->app_model->get_single_app($id);
$this->load->view('app/single_app',['single_app'=>$single_app]);
}
路线:
$route['(:any)/(:num)'] = "controller/function/$1/$2";
我想在点击锚标记时加载视图,并显示类似的网址
http://localhost/project/inventory_control_supervisor/1/
http://localhost/project/waste_stream_coordinator/3/
URL 会根据应用程序 ID 不断变化。
我正在加载视图有问题吗?或者要使用我必须使用重定向的路线?
【问题讨论】:
标签: php codeigniter routes