我尝试过以下操作,但遗憾的是它不起作用:
$route['request-guide'] = "request_guide";
在我的应用程序/核心中,我创建了MY_Router.php,但这也无效。
<?php
defined('BASEPATH') || exit('No direct script access allowed');
class MY_Router extends CI_Router {
function _set_request ($seg = array())
{
// The str_replace() below goes through all our segments
// and replaces the hyphens with underscores making it
// possible to use hyphens in controllers, folder names and
// function names
parent::_set_request(str_replace('-', '_', $seg));
}
}
?>