[eluser]Bionicjoe[/eluser]
I have two view files, one for just looking at a ticket and one for editing a ticket. I'm re-using a bunch of the same code in each file.
What is the best way to do this so I don't need to layout the same field data in each view file?
File 1 (plus there's a bunch more fields set up this way)
Code:
$ticketnumber = array(
'name' => 'ticketnumber',
'id' => 'ticketnumber',
'maxlength' => '15',
'size' => '25',
'style' => 'width:25%',
);
File 2 (same fields plus a value attribute)
Code:
$ticketnumber = array(
'name' => 'ticketnumber',
'id' => 'ticketnumber',
'maxlength' => '15',
'size' => '15',
'style' => 'width:25%',
'value' => $row[0]->ticketnumber,
);
Creating a file to include and using this didn't work. (loading at beginning of view file)
Code:
$this->load->file('system/application/include/outageview_inc.php', false);