Codeigniter MVC controller architecture
Posted
by justinbach
on Stack Overflow
See other posts from Stack Overflow
or by justinbach
Published on 2010-03-16T18:06:21Z
Indexed on
2010/03/16
18:11 UTC
Read the original article
Hit count: 356
I'm building a site using CodeIgniter that largely consists of static content (although there will be a relatively small CMS backend, and there's code to handle localization/internationalization based on the domain used to access it). Typically, in a situation like this, I'd use a Pages controller that is in charge of rendering static content, but as there are a fair number of pages on the site (30+) it'd quickly end up containing lots of methods (assuming one per page).
Should I break my Pages controller into multiple controllers (that perhaps inherit from it) according to different sections of the site? Should I organize methods differently in the Pages controller? What's the best practice here?
Thanks!
Justin
© Stack Overflow or respective owner