Hailwood
Hailwood

Reputation: 92581

Module specific routing using hmvc in code igniter?

I am using Code igniter with HMVC,

We are creating drop-in modules.

One thing I am a bit stuck on though is the routing.

I can add

$route['gallery/categories'] = 'gallery/categorieseditor';
$route['gallery/categories/(:any)] = 'gallery/categorieseditor/$1';

to the main routes.php config file and it works fine.

But I don't want to have to edit the main routes file for the modules.

I was hoping I could just drop this into a routes.php file in /modules/gallery/config/ But visiting the url just gives me a 404 (accessing /gallery/categorieseditor works).

How can I get this up and running?

Upvotes: 0

Views: 773

Answers (1)

seangates
seangates

Reputation: 1522

You have an error in your code:

$route['gallery/categories/(:any)] = 'gallery/categorieseditor/$1';

Should be:

$route['gallery/categories/(:any)'] = 'gallery/categorieseditor/$1';

Upvotes: 1

Related Questions