0
$route['[0-9A-Za-z]'] = "editor/index/$1";
當我看着我的編輯控制器,在索引方法中,我沒有得到參數通過。它只是說, 「$ 1」爲什麼不會在CodeIgniter中傳遞參數?
$route['[0-9A-Za-z]'] = "editor/index/$1";
當我看着我的編輯控制器,在索引方法中,我沒有得到參數通過。它只是說, 「$ 1」爲什麼不會在CodeIgniter中傳遞參數?
你可以嘗試只$route[ '(:any)' ] = "editor"
然後,只需辦理必要的:
function index() {
$id = $this->uri->segment(3); // Or whatever segment you end up with.
// Do something.
}