Welcome Guest, Not a member yet? Register   Sign In
Advice on admin layout
#1

[eluser]Unknown[/eluser]
I am fairly new to CI and I wanted to know all of your opinions on the best way to layout your admin.

Here is my current setup:

Code:
controllers/
    admin/
        dashboard.php
        news.php
    login.php

view/
    admin/
        dashboard_view.php
        news_view.php
    login_view.php

I don't like it however, it seems messy. Would I be better off placing the entire admin into one controller? one view?

Do yall put your admin functions in sub-folders???

Your advice would be greatly appreciated.
#2

[eluser]laytone[/eluser]
It just depends how large your application is. What you have up there doesn't seem so messy to me... except I usually make login a function in my controllers. or my MY_Controller class.

If your application isn't really large, put all the functions in one controller. If you have lots of stuff in your admin section, separate the sections into different controllers

i.e.
controllers/admin/admin.php
controllers/admin/reports.php
controllers/admin/users.php

If I'm not sure whats going to come of it I usually start with one controller and when I see that I'm creating a lot of different functions for the same purpose I create a new controller and throw it all in there.
#3

[eluser]mikelbring[/eluser]
I actually use my admin as a separate application. This is how mine goes:

Code:
application/
    admin/
    public/
system/
html/
    admin/
    index.php (points to ../../application/admin
    index.php (points to ../application/public)

I keep everything out of the public (html) directory besides the images, styles, javascript, and needed indexes to call the application. But of course, if you admin isn't very big id do what laytone said.
#4

[eluser]umefarooq[/eluser]
for creating admin panel read this tutorial will help you more try 3 method in this tutorial with modular separation very easy to manage admin

admin tutorial
http://philsturgeon.co.uk/news/2009/07/C...odeIgniter

modular separation
http://ellislab.com/forums/viewthread/121820/
#5

[eluser]Udi[/eluser]
I separate my modules inside MCV folders.
I have:
controllers/
user/

Inside user, I have controller for administration and client side.
If a controller class is for admins only, the method I have in MY_Controller taking care if the tests and redirection if needed.
#6

[eluser]Phil Sturgeon[/eluser]
Here is a detailed breakdown of each way to make an admin panel I can think of, with pro's and con's.

Also, Udi is talking about MY_Controller and admin specific stuff, here is a guide on how to set that up.
#7

[eluser]woony[/eluser]
I also have different applications for larger projects.
have an index.php that uses applications folder and admin.php that uses admin folder as application.




Theme © iAndrew 2016 - Forum software by © MyBB