CodeIgniter Forums
creating an admin folder - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: creating an admin folder (/showthread.php?tid=39044)



creating an admin folder - El Forum - 02-27-2011

[eluser]xerosis[/eluser]
My website (like most websites) consists of two parts:
Frontend and Backend.

Now the backend has MANY controllers, models, etc. and the frontend also has its share of the same.

I would like to separate the backend so that it places it and all its files under:

www.mywebsite.com/admin

while the frontend stays www.mywebsite.com

How can I do this? without having a controller called "admin" with EVERYTHING inside that?


creating an admin folder - El Forum - 02-27-2011

[eluser]grisha[/eluser]
Create a folder named admin in your controllers directory.

controllers/welcome.php
controllers/admin/welcome.php

Both front- and back-end of your application should share the models - much more easy to maintain.


creating an admin folder - El Forum - 02-27-2011

[eluser]InsiteFX[/eluser]
application/controllers/admin
application/views/admin

InsiteFX


creating an admin folder - El Forum - 02-27-2011

[eluser]Boris Strahija[/eluser]
I like the approach with modules best, and this is how I use it most of the times. Basically it's very similar to this article:
http://philsturgeon.co.uk/news/2009/07/Create-an-Admin-panel-with-CodeIgniter