Welcome Guest, Not a member yet? Register   Sign In
Routing and controllers
#2

[eluser]Andrew Cairns[/eluser]
Hi Martin,

My first thought would be to change your planned uri.
I would have a Blog controller, as you are viewing the archive of the blog - unless you have multiple archives, then .. ignore this Smile

Your route for this would then be something like:
$route['blog/archive/(:any)'] = "blog/controller_name_here/method_you_want_to_call/$1";
(I use the HMVC extension, so blog would be my module and archive would be my controller)

You could also:
$route['blog/archive/(:any)'] = "controller_name_here/method_you_want_to_call/$1";

Viewing a current blog post would be almost identical:
$route['blog/(:any)'] = "controller_name_here/method_you_want_to_call/$1";

if using HMVC:
$route['blog/(:any)'] = "blog/controller_name_here/method_you_want_to_call/$1";


Messages In This Thread
Routing and controllers - by El Forum - 12-29-2009, 09:27 AM
Routing and controllers - by El Forum - 12-29-2009, 10:01 AM
Routing and controllers - by El Forum - 12-29-2009, 11:48 AM
Routing and controllers - by El Forum - 12-29-2009, 11:49 AM
Routing and controllers - by El Forum - 12-29-2009, 11:51 AM
Routing and controllers - by El Forum - 12-29-2009, 11:54 AM
Routing and controllers - by El Forum - 12-29-2009, 12:05 PM
Routing and controllers - by El Forum - 12-30-2009, 06:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB