Welcome Guest, Not a member yet? Register   Sign In
Controller in second segment
#1

[eluser]Bursh[/eluser]
Hey.

At the moment, I'm writing a really simple CMS for myself. I've come up against a problem though, and I can't think how I could solve it. What I'd like to do is have URI's like "Admin/Login/"(Login is a function within the admin controller) and "Admin/CP/Action" but I don't want to keep all the functions within the Admin controller, because that's too messy (for me, at least), instead I'd like delegate the functioning of the control panel to a controller named "CP" and even have URI's like "Admin/CP/Action/Stage1/".

My first reaction was "put everything in a folder called 'Admin' and look for the controllers in there" but when I tried it I realised I couldn't have "Admin/Login/" because that just looks for the login controller and doesn't specify an action. My next step was to add an admin controller to the folder, but that didn't work either because I'd have to have "Admin/Admin/Login/" which I don't want.

Does anybody have any ideas how I can do this? I'm totally stumped. Thank you in advance to anybody who can clear this up for me.

Regards,
Bursh
#2

[eluser]Seppo[/eluser]
When no action is specified CI calls "index" method, so you can have admin folder with login controller and an index action and use "admin/login". Also, if that's not good enough, you can use routing
#3

[eluser]Bursh[/eluser]
Thanks, I'll try that!




Theme © iAndrew 2016 - Forum software by © MyBB