How to create Admin panel folder? |
[eluser]web_developer[/eluser]
Hello, Here is my directory structure.. /system/application/controllers/admin/login.php <--- Admin Directory /system/application/controllers/home.php <--- Default Home page http://www.test.com <-- Home page is working fine.. http://www.test.com/admin <--- Admin is not working. Because in route default home page can come easily but how to route admin panel? Please explain the steps in easiest way. Thanks
[eluser]iFadey[/eluser]
You need to understand how CodeIgniter's URLs work. Better read this: http://ellislab.com/codeigniter/user-gui.../urls.html Your login URL is not test.com/admin. Actually it's test.com/admin/login
[eluser]stommert[/eluser]
add $route['admin'] = "admin/login"; to your routes.php in the config directory of your application.
[eluser]web_developer[/eluser]
Already tried that way.. But not working.. admin/login <-- It is considering "admin" as a class and loging as a function.
[eluser]Phil Sturgeon[/eluser]
If you put that as a route then you are screwed past login, as all requests directly to admin will force a login. Sub-folders are a pain in the ass for admin panels. Check out this article on the topic to see the advantages and disadvantages of each method.
[eluser]web_developer[/eluser]
hmm then what should do? I want to keep admin file seperately... OR I have to do mix admin files with frontend? Which is the good way?
[eluser]Phil Sturgeon[/eluser]
The whole point is there are many ways to do it, and that article explains them all. You don't HAVE to do anything. I prefer to keep my files grouped in a modular way, meaning everything to do with a blog is in a "blog" module. That means frontend, backend (admin) etc is all in the same place. You CAN use sub-folders, but it gets messy as your app grows. It's all on Google buddy. :-)
[eluser]web_developer[/eluser]
if I create Frotend and Backend seperately then every thing will become double. 2 config directory, 2 library. --> I have to define 2 times DB settings. (For Frontend and for Admin) --> I can't use my common function in admin as well as frontend. I have to declare in both library. This is not the good way.
[eluser]Phil Sturgeon[/eluser]
Which is exactly what the article says. Read the whole thing. ;-)
[eluser]eokorie[/eluser]
I have actually been using a separate frontend and backend for the CMS i am currently working on. Definitely is a bit of a pain in the back side so I am going to consider changing things a bit myself. |
Welcome Guest, Not a member yet? Register Sign In |