Search code examples
phpmodulekohana

How to add route like example.com/module/controller/function/params in kohana


for example:

/modules/test/controllers/index.php - folder structure

example.com/test/index/param1/someValue - url

or something like this.

What I need to write in the bootstrap to make this path?

Route::set('test', 'test')
  ->defaults(array(
      'directory'  => 'modules/test/controllers',
      'controller' => 'index',
      'action'     => 'index',
  ));

But this does not work.


Solution

  • I found the Kohana routing doc's a little lacking and wrote a very detailed overview that should answer your question: http://www.kineticklink.com/kohana-3-routing/

    Note: I never got to the more advanced regular expression matching stuff--was going to be a part 3