[eluser]opel[/eluser]
I am trying still new to CI and not sure the best way to do the following.
I want set a global $data variable in my models that I can use for add and edit functions such as this :
Code:
$data = array('title' => $_POST['title'],
'order' => $_POST['order'],
'file' => $_POST['file'] );
However setting in in a variable, public or private throws up errors.
I have also tried using : $this->input->post('variable'); but I couldn't get it to work.
My aim is to use the a $data and $id variable in functions such as this :
Code:
function update()
{
$this->db->where('id', $this->id);
$this->db->update($this->table, $this->data);
}
Any advice would be appreciated.