[eluser]lopetzi[/eluser]
I made a MY_Controller library:
Code:
<?php
class MY_Controller extends Controller {
function auto()
{
$user = 'Guest';
$general = $this->general->get_general();
$template['welcome'] = 'Welcome, ' . $user;
$template['description'] = $general->description;
$template['keywords'] = $general->keywords;
$template['price'] = $general->price;
}
}
and now home looks like this:
Code:
<?php
class Home extends MY_Controller {
function Home()
{
parent::MY_Controller();
}
function index()
{
$template['heading'] = 'HOME';
$template['title'] = 'Titlu';
$template['left'] = $this->load->view('home','',true);
$template['right'] = $this->load->view('newsform','',true);
$this->load->view('main', $template);
$this->output->enable_profiler(TRUE);
}
}
I get errors that variables in the library are not set.
I don't know how to use the data in the library
For example: how do i echo $user from the library?
Thanks