Re: accessing variables within objects



Notice: Undefined property: FastTemplate::$main in
/whereever/inc.template.php on line 293

The basis of a lot of PHP template classes is that you can access
arbitrary properties on an instance after setting them.

$obj = new stdClass();
$obj->foo = 'bar';
echo $obj->foo; // defined, no notice

Whereas:

$obj = new stdClass();
echo $obj->foo; // accessing undefined property

If your template class needs to support the latter, you could try
this:

class MyTemplate extends FastTemplate {
public function __get($name)
{
return null;
}
}

Steve
.