My display model

As promised, here is our display model (slightly simplified):

<?php class Display extends Model { /*create the array to pass to the views*/ var $data = array(); /*two other class variables*/ var $base; var $status = ''; /*the constructor function: this calls the 'model' parent class, loads other CI libraries and helpers it requires, and dynamically sets variables*/ function Display() { parent::Model(); $this->load->helper('form'); $this->load->library('user_agent'); $this->load->library('menu'); $this->load->library('session'); /*now set the standard parts of the array*/ $this->data['css'] = $this->config->item('css'); $this->data['base'] = $this->config->item('base_url'); $this->base = $this->config->item('base_url'); $this->data['myrobots'] ...

Get CodeIgniter 1.7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.