• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with admin routes

#1
[eluser]nuts[/eluser]
Hello,

I started with CodeIgniter few days ago, and I've found this framework very interesting.

But I encounter a problem with my routes, I want to make /controller/admin_action accessible by /admin/controller/action

I tried
Code:
$route['/(.+?)(/admin_)(.+?)/'] = "admin/$1/$2";

But It's not working, can someone help me ? :-)

Thanks,

Ps: Sorry if I have not a good english :red:

#2
[eluser]CodyPChristian[/eluser]
So you're wanting a setup like:

domain/admin/admin_controllers?

if so make your 'admin' a directory and put your controllers inside, then just map that path to the first controller

Code:
$route['admin'] = "admin/admin";

You can also do domain/admin_controller/functions, doing this though is going to make a very large controller, I think you would be better off with the first layout.

Cheers!

p.s. Welcome to the forums

#3
[eluser]nuts[/eluser]
Ok it's working thanks for your help, it's not exactly what I wanted but that's convenient for my use.

p.s. I think it's the first but not the last time I ask question :p


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.