Periods not allowed in CodeIgniter URI?

后端 未结 3 1361
粉色の甜心
粉色の甜心 2021-01-29 05:18

So after reading this question on API versioning, I decided to prefix all my routes with a version number:

http://localhost/api/1.0/user/login

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-29 05:46

    The problem is on line 468 of system/core/Router.php. Change set_directory from this:

    $this->directory = str_replace(array('/', '.'), '', $dir).'/';
    

    To this:

    $this->directory = str_replace(array('/'), '', $dir).'/';
    

    Anyone have a guess or gander as to why the Router removes periods from directory names?

提交回复
热议问题