CodeIgniter Forums
Admin Section - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Admin Section (/showthread.php?tid=15239)



Admin Section - El Forum - 01-29-2009

[eluser]NateL[/eluser]
My little app will have pretty much 2 user roles. Admin, and viewer.

I have the set up laid out properly, I think..this is sort of a shopping cart (but without the checkout abilities)

example.com/available (CI root...this is what the public sees. )

example.com/available/admin (this is where the admin goes to log in)

example.com/available/admin/animal/edit/5 (controller/function/id)
example.com/available/admin/animal/add
example.com/available/admin/animal/delete/5

and so on...

so, would I create an admin folder inside my controllers? and then create a NEW controller called 'animal_admin', and then would that file simply extend what is already there? for example:

Code:
class Animal_admin extends Animal(){
// admin functions go here
}

it would be structured like so:
/controllers/animal.php
/controllers/admin/animal_admin.php

Thanks for any tips or advice Smile


Admin Section - El Forum - 01-29-2009

[eluser]gullah[/eluser]
I have my admin pages in folders and I just extend the class from the main controller. I don't think there is any point in extending another one of your controllers unless you plan on using functionality from that controller.


Admin Section - El Forum - 01-30-2009

[eluser]umefarooq[/eluser]
you can use modular extension for you application , you can have the same structure which you are looking for. here is the link for HMVC modular extension download and installation guide link

http://codeigniter.com/wiki/Modular_Extensions_-_HMVC/