Kohana v2 - problem with routes

Posted by yoda on Stack Overflow See other posts from Stack Overflow or by yoda
Published on 2010-03-25T22:20:18Z Indexed on 2010/03/25 22:23 UTC
Read the original article Hit count: 242

Filed under:
|
|

Hi,

I'm attempting to set some custom routes in Kohana v2. What I'm looking for is some method that allow the system to :

  • follow a pre-defined name to it's related root;
  • redirect the non-matched url's into another controller;

To give you a more clear view over the problem, I want the first url parameter to be associated to certain pages (contacts, home, services, about us, etc), and those urls who doesn't match the previous pages would be routed into a controller called products, in order to determine if the first url parameter regards a product name.

Here's a sample of what I have :

$config['_default'] = 'home';
$config['([a-zA-Z]+)'] = 'products/showcat/$1';

What am I missing here?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about kohana

Related posts about routes