[eluser]clowngoblin[/eluser]
Hello,
first i am new for php programing. i read documents and searched on google but didnt find it.
i have a model Brand(record_id,name) and listing object on view with form no problem.
Controller :
Code:
function update($recordId){
$brand = Prt_Brand::find($recordId);
$data['brand'] = $brand;
$data['page']='prt_brand_form';
$this->load->view('index_view',$data);
}
View
Code:
<body>
<?php $attributes = array('name' => 'brand');
echo form_open('prt_brand_controller/save',$attributes);?>
<table>
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th></th>
<th></th>
</tr>
</thead>
<tr>
<td>Name</td>
<td><?php echo form_hidden('record_id',$brand->record_id);?>
<input type="text" name="name" id=<?=$brand->record_id?> value=<?php echo $brand->name?> maxlength="100" size="50" style="width:50%" /></td>
</tr>
<tr>
<td><input type="submit" name="mysubmit" value="Submit Post!" /></td>
</tr>
</table>
</body>
Controller Save:
Code:
$brand = $this->input->post('brand'); //HERE CANT GET MODEL!
$brand->record_id;// DONT WORK!
can i bind form(name is brand in view) to model in controller or must i get atributes one by one?
thnks for your replies.