[eluser]musikbox[/eluser]
Hi, I'm new to using CodeIgniter so I've probably made some fundamental mistake, please correct!
Anyways I'm trying to load database data with a Model, then pass it through in the controller, however it gives me this error
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Edit_product::$model
Filename: controllers/edit_product.php
Line Number: 21
this is my controller
Code:
public function _construct(){
parent::_construct();
$this->load->model('products_model', 'model'); //this seems to be the problem
}
public function index(){
$this->load->helper('url');
$data['base'] = $this->config->item('base_url');
$data['css'] = $this->config->item('css');
$data['products'] = $this->model->getProducts(); //and this
$this->load->view('edit_product_view',$data);
}
I also tried calling load without giving the model a name, but that doesn't work either.
Thanks!