Welcome Guest, Not a member yet? Register   Sign In
uri routing help
#1

[eluser]Mutsop[/eluser]
Hi,

Ftm I'm creating an Admin panel using ionAuth.
Now for the renaming I split the controller in 2 (everything that has to do with logging in and the other part with users/modification).

So in my controller folder I have a file admin.php which contains the login, logout, forget_password.
And in my controller I have a Folder named admin with several controllers and also the user file.

How do I make a difference between admin file and folder?

I mean when I type the url admin/user I will get an 404 error. as he is searching the admin file and not the folder....


Any ideas?

EDIT:
k so I tried using
$route['admin/:any'] = "admin/:any";
In the hope it would take the same segment... but apparently not.
#2

[eluser]Madmartigan1[/eluser]
I'm not 100% sure, but I think having a controller with the name 'admin' sitting next to a directory named 'admin', the route for anything inside it would be /admin/admin/controller.

Quote:And in my controller I have a Folder named admin with several controllers and also the user file.

This is a bit confusing. Can you show us the directory structure?
#3

[eluser]Mutsop[/eluser]
controller
-admin.php (containing login, logout, forgot_password)
-admin
-dashboard.php
#4

[eluser]Madmartigan1[/eluser]
I'd suggest that you rename the login/logout controller to something else, then you won't have any issues.

Mine is called "users". It's just the most simple way, otherwise you will have routing nightmares.

Also, read this article if you haven't already:

http://philsturgeon.co.uk/news/2009/07/C...odeIgniter
#5

[eluser]Mutsop[/eluser]
Well I might have found a solution to this....
I just renamed the admin.php to administrator.php and routed it to admin

I just need to test it a bit more Smile




Theme © iAndrew 2016 - Forum software by © MyBB