开发者

Routing problem with Kohana 3.0

开发者 https://www.devze.com 2023-01-22 03:26 出处:网络
in my current project ive a controller tree like this: Controller - ------Admin - ------------user.php ------otherClass.php

in my current project ive a controller tree like this:

Controller -

------Admin -

------------user.php

------otherClass.php

Where controller and admin are folder and user and otherClass are the classes.

If i want to call any otherClass method the url would be this one:

example.com/otherClass

But when i try to call the users methods like this:

example.com/admin/user

i get this : Class controller_admin does not exist (whats logical), so i tried with the routs in the bootstrap.php and after many failed tries, i gave up and decided to ask you guys :P .

The question is how should i code the route::set to make this wo开发者_JAVA技巧rk.

Thanks


First thing is that you must set 'index_file' key to FALSE in bootstrap (when Kohana::init() is being called).

Leave the default route as it is ( it's controller/action/id, with controller and action being 'index' by default).

For more informations take a look at kohana 3 routing basics article

0

精彩评论

暂无评论...
验证码 换一张
取 消