Search code examples
phpkohanakohana-3kohana-authkohana-3.0

Kohana user model


I'm trying to add custom pages to user model.

If I would be making simple pages I would simply create controller in my application\classes\controller and a view file in \application\views, but now I would like to do same thing with user module.

I found view files in modules\user\views\user but I can't find controller or anything else what is loading them.

I've tried to simply make new file called test.php and then navigated to localhost/user/test but get an error:

The requested URL user/test was not found on this server.

If i would try localhost/user/profile everything works just fine. What am I doing wrong here?


Solution

  • If localhost/user/profile works for you, there should be a function called action_profile() somewhere in that user module.

    Do a global search for "action_profile" and you should be able to find the controller file that is serving that URL. Then, you can add another action for the new page that you want to add.

    Or, you may be able to add a controller to that same directory if you specifically want a new controller.

    Either way, if it doesn't work, you may need to modify the routes (in your bootstrap or in the module's init.php file).