[eluser]BobbyB[/eluser]
Hi folks,
I am trying to pass variables to a model, and tried the above solutions.
But I must be doing sth wrong.
In my controller I got:
Code:
class Freebies extends Controller {
function Freebies()
{
parent::Controller();
$this->load->helper(array('form', 'url'));
}
function index()
{
$this->load->model('Get_freebies');
$cat = $this->input->get_post('category', TRUE);
$this->model->add($cat);
$data['freebies'] = $this->Get_freebies->getselect();
$this->load->view('freebies_view', $data);
}
}
It says "Fatal error: Call to a member function on a non-object..."
I am trying to pass a "post" variable from a form to the controller and finally to the model.
Can I pass variables to only a single function(getselect()
in a model or will they be passed to all the functions in the model?
Thaks in advance!