[eluser]stevefink[/eluser]
Well currently I have it setup like this. Very simple example:
Function in my model:
Code:
function get_makes()
{
// return all makes.
$query = $this->db->get('makes');
return $query;
}
my controller:
Code:
function carinfo()
{
// We'll use the Autodb_model for all of our database interaction
// and name it autodb for ease of use.
$this->load->model('Autodb_model', 'autodb');
// Pull the available makes out of the db and populate
// the respective select parameter.
$data['makes'] = $this->autodb->get_makes();
// drop knowledge into the view.
$this->load->view('console/car_info_view', $data);
}
And finally, my view:
Code:
<label>Make <span class="required"> * </span></label>
<select name="make" id="make">
<option>**********</option>
<option value="add_make">Add Make</option>
<?php foreach($makes->result() as $make): ?>
<option value="<?= strtolower($make->name) ?>"> <?= $make->name; ?> </option>
<?php endforeach; ?>
</select> <br>
Again it works great, I just like to learn how everyone else does it to keep improving my scalability/architecture type skills. Heck, I'm almost willing to put off all the questions so I can just finish the project, then pay an expert to do nothing but critique my working code just so I can do it more efficiently in the future. :-)
- sf