[eluser]Unknown[/eluser]
Thanks Yorick,
Had a play with your suggestion, but got an error when using private $data;, but not when using var $data;
Looked into it, and realised it's because my server's running PHP4.
Also, putting the code in the __construct() function didn't work, but again figured that was a PHP5 thing.
Converted to PHP4 and it works a treat.
Categories Controller Code:
Code:
class Categories extends Controller {
var $data;
function Categories()
{
parent::Controller();
$this->data['categories'] = $this->MCategories->getAllCategories();
}
function index()
{
$this->data['content'] = "v_homepage";
$this->data['title'] = "Product Categories";
$this->data['homeProducts'] = $this->MProducts->getRandomProducts(6);
$this->load->view('v_template',$this->data);
}
}
Many thanks