Welcome Guest, Not a member yet? Register   Sign In
Newbite Correct Site Structure Set Up Question
#1

[eluser]opel[/eluser]
Hi I'm new to Code Ignite and still working through 1st few tutorials. I plan to make a small CMS system and want to check my plan for setting up my CI structure is correct.

Usually when I create dynamic sites I have an admin directory that is secured by user login system. The database structure is then fed out to the public pages as usual.

Using CI's MVC would I create an "admin" controller with admin views for adding news, adding links etc. Then controllers/views for the public sections ?
#2

[eluser]Kemik[/eluser]
From what I've seen I think it goes something along the lines of this example...

All user events such as register, log in, log out, forgotten password, profile, edit profile goes in controller you could call "user".

Then all the news events such as display news, add comments, view comments would go in a controller called "news".

So break down your website in to sections or "modules" I suppose you could say.

Anyone else please feel free to tell me if I got it wrong too. I'm still learning Wink
#3

[eluser]opel[/eluser]
Would add news go into the user controller keep that in news and just protect it with the user security level ?
#4

[eluser]Phil Sturgeon[/eluser]
Still have your admin folder ,can be very handy to split that up. Can have controllers/blog for normal stuff and controllers/admincp/blog for administration. Admin files can have a basic "if(user_level > 5) go ahead, else piss off" type thing in constructors, or you can make a hook.

An example would be for a hook to load on all pages then do a test on directory.

Code:
if(directory == 'admincp/'):
  if(!isAdmin()) echo "Denied, get out of here!";
endif;

Obviously make the isAdmin yourself :p
#5

[eluser]opel[/eluser]
Thanks for that I'll try it out and see how I get on.




Theme © iAndrew 2016 - Forum software by © MyBB