How to create Admin panel folder?

#1
[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

#2
[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

#3
[eluser]stommert[/eluser]
add

$route['admin'] = "admin/login";

to your routes.php in the config directory of your application.

#4
[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.

#5
[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.

#6
[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?

#7
[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. :-)

#8
[eluser]web_developer[/eluser]
if I create Frotend and Backend seperately then every thing will become double.

2 config directory,
2 library.

--&gt; I have to define 2 times DB settings. (For Frontend and for Admin)
--&gt; 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.

#9
[eluser]Phil Sturgeon[/eluser]
Which is exactly what the article says. Read the whole thing. ;-)

#10
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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