Welcome Guest, Not a member yet? Register   Sign In
Proper MVC design
#1

[eluser]AtlantixMedia[/eluser]
Hello everybody,

I recently started playing with CI and MVC and decided I will recode my projects which have always been "procedural" in nature. I started with the admin panel. wanted to make sure I'm doing things right. In the admin panel I have a menu with:

Configuration
--Add configuration variable
--View configuration variables
--etc
Sitemaps
--Load sitemap
--View sitemap
--etc
Tables
--Show tables
--etc

to achieve this I'm using one controller called Admin, one model called Admin_Model, and a View. The submenu items all point to functions which are inside the Admin controller. Every access is strictly done in the Model and any input goes strictly through the Controller which does routine checks and passes it to the Model through variables.

now my questions are:

1) should I have different controllers for each important section of the admin area instead of having just one Admin controller? for example, one controller for sitemaps, and so on?
2) I have read that the View is independent on changes occuring to the Model. That is, if a column name changes in the database, the View will still work. I do not understand this as the Model gets database data and passes it to the Controller as an associative array. The View then blends that with HTML but it may refer to array indexes which are actually database table fields names. i.e.: <?php echo $data['Item_ID']; ?> where Item_ID is a table field name. am I missing something here?

thanks


Messages In This Thread
Proper MVC design - by El Forum - 12-09-2007, 10:45 AM
Proper MVC design - by El Forum - 12-09-2007, 12:26 PM
Proper MVC design - by El Forum - 12-09-2007, 12:47 PM
Proper MVC design - by El Forum - 12-09-2007, 12:53 PM
Proper MVC design - by El Forum - 12-09-2007, 01:02 PM
Proper MVC design - by El Forum - 12-10-2007, 07:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB