php-router: Wrong route when run in sub-folder
Hello. I just check your code and got one issue when run with sub-folder
Example URL: http://localhost/cms/test cms is sub-folder
$router->get('test','Test@test');
Return Route
array(7) {
--
["router"]=>
array(7) {
["route"]=>
string(5) "/cms/test"
["method"]=>
string(3) "GET"
["callback"]=>
string(9) "Test@test"
["name"]=>
string(9) "test.test"
["before"]=>
NULL
["after"]=>
NULL
["group"]=>
NULL
}
route should be only test
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 23 (14 by maintainers)
Commits related to this issue
- Bug fixed about sub-directory routing path. Also, some refactoring has been applied. — committed to izniburak/php-router by izniburak 4 years ago
I’ve just released a new version that contains some fixes related to the issue. You can update your package via
composer
!@peter279k It make sense. Actually, I’ve started to work to add sub-folder support on
php-router
. I’m continue to work. We will figure it out.This is my folder.
index.php
this is result
You can see demo included routes lists