
Feature request - Remove $db refs from Controller--ONLY use models; likewise output ONLY via Views
Reported by dleffler | September 11th, 2012 @ 11:01 PM
This is an 'in a perfect world' type request to move all the direct database calls ($db object) into the model(s). The Controller should NEVER act directly on the database, after all that is the purpose of the Model in MVC. The Controller should act through the model to manipulate any data.
Likewise, the Controller should never really output anything without going through a 'view'. Though there would be some exceptions to this, esp. in regards to messages (expQueue, etc...)
Comments and changes to this ticket
-
dleffler September 11th, 2012 @ 11:05 PM
As a note, it is NOT inherently wrong to access the database from the Controller, but implies sloppy coding which should be incorporated into the Model. This will likely require creating models for most of the data model definitions.
Same thing for Controller output. Shouldn't be doing any 'echo' or 'print_r' type output in a Controller.
-
dleffler September 12th, 2012 @ 01:43 PM
- Title changed from Feature request - No $db refs in Controller, ONLY use model; similar for output ONLY w/ Views to Feature request - Remove $db refs from Controller--ONLY use models; likewise output ONLY via Views
-
dleffler September 17th, 2012 @ 01:28 PM
- Milestone set to 2.1.0
- Milestone order changed from 203 to 0
-
dleffler November 21st, 2012 @ 08:56 PM
- Milestone changed from 2.1.0 to 2.1.1
- Milestone order changed from 15 to 0
-
-
-
dleffler February 16th, 2013 @ 02:56 AM
- Milestone changed from 2.2.0alpha2 to 2.2.0alpha3
-
dleffler March 2nd, 2013 @ 09:45 PM
- Milestone changed from 2.2.0alpha3 to 2.2.0beta1
-
dleffler March 16th, 2013 @ 03:28 AM
- Milestone changed from 2.2.0beta1 to 2.2.0beta2
-
dleffler March 29th, 2013 @ 08:00 PM
- Milestone changed from 2.2.0beta2 to 2.2.0beta3
-
dleffler April 20th, 2013 @ 10:17 AM
- Milestone changed from 2.2.0beta3 to 2.2.0release-candidate
-
dleffler May 1st, 2013 @ 10:22 AM
- Milestone changed from 2.2.0release-candidate to 2.2.1
-
-
expNinja July 27th, 2013 @ 08:23 PM
- Assigned user set to dleffler
- Milestone set to 2.2.2
(from [4533b423d7fd2d2c99fd48f29341112a10c5425c]) Moves many $db ref's from controller into model [#713 milestone:2.2.2 responsible:dleffler] https://github.com/exponentcms/exponent-cms/commit/4533b423d7fd2d2c...
-
dleffler August 14th, 2013 @ 07:26 PM
- Milestone changed from 2.2.2 to 2.2.3
-
dleffler August 16th, 2013 @ 06:18 PM
- Assigned user cleared.
- Milestone cleared.
-
-
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Bug Tracker for Exponent CMS