Display fetch data in the database inside the view |
[eluser]Otemu[/eluser]
Hi, Generally what should go in the view is as follows: Should mainly contain presentational code, such as HTML, and simple PHP code to traverse, format and render data; should avoid containing code that performs explicit DB queries. Such code is better placed in models. should avoid direct access to $_GET, $_POST, or other similar variables that represent the end user request. This is the controller's job. The view should be focused on the display and layout of the data provided to it by the controller and/or model, but not attempting to access request variables or the database directly. may access properties and methods of controllers and models directly. However, this should be done only for the purpose of presentation. Source here although the tips apply to the yii framework the concepts are more or less the same for codeigniter Check out the CodeIgniter From Scratch tutorials found here |
Messages In This Thread |
Display fetch data in the database inside the view - by El Forum - 05-01-2013, 05:36 PM
Display fetch data in the database inside the view - by El Forum - 05-02-2013, 05:00 AM
|