Welcome Guest, Not a member yet? Register   Sign In
Setting out Controllers with features of the site
#1

[eluser]JamieBarton[/eluser]
Hi guys,

I'm wondering how to do this with CI:

I'm wanting to know how I can arrange my files/controllers with features on the site.

My site will be like a photo gallery, that shows all albums uploaded by family members on a page to view all albums, and a page to show albums by the user.

Features of albums will be:

- Create album
- Edit Album
- Delete Album (Probably will be ajax based on click with confirmation)

Features of the photos will be:

- Upload Photos
- Edit Photos
- Delete Photos (Probably will be ajax based on click with confirmation)

Now, if I wanted to:

- View albums uploaded by all family members (family_id) - Each user has a family_id
- View albums uploaded by user

- View Photos in album - Thumbnail view listing - (selected above)
- View Individual Photo - When clicked from thumbnail


What would be the best way of setting out the controllers for this?

I see on this forum to edit a reply etc.. is /forums/editreply/ID, theres a lot like that, but are they using Routes? I can't imagine there being separate controllers for all of those?


Any help would be appreciated and remember I'm very new to CI and MVC.


Regards,

Jamie
#2

[eluser]jedd[/eluser]
My gut feel is that you'd bang all that stuff into a single controller. You'd have a handful of visible methods - album index, photos in an album, upload, edit/modify and so on. Your views would likely contain more code, especially if you're going to get ajax-happy, and of course you'd have a model behind that to do whatever farnarkling you need.

My gallery that I'm writing at the moment - albeit lacking any upload features at all - is probably about 80% complete on the controller side, and the stats for that at the moment are pretty good - 650 lines of code made up of 130 blank, 250 code, 250 comment.




Theme © iAndrew 2016 - Forum software by © MyBB