[eluser]mortifrog[/eluser]
Hi, I've been using PHP quite successfully for a number of years but am new to OO and programming with any sort of framework. I think if I can crack this CI methodology, I will be on fire, but so far I'm just managing the odd spark!
Can someone tell what's wrong with the following code please?
Code:
class Welcome extends Controller {
var $content;
function Welcome()
{
parent::Controller();
$this->content='q_content';
}
function index()
{
echo $this->content; # this works
$this->load->view('q_page_open');
$this->load->view($this->$content); # this doesn't - why?
$this->load->view('q_page_close');
}
}
CI gives me an error of: Undefined variable: content
and PHP chucks up - Cannot access empty property in ....
It seems to me as if I have defined a property named q_page and am asking to load it's contents as a view? I know I must be being dim, but I'm too dim on this occasion to work out why!