new here I've another question. I'm using a little Template class in php 5.21.
But php send the following error:
the classIndirect modification of overloaded property
Code: Select all
class XTemplate
{
private $_variables = array();
public function __set($key, $value)
{
$this->_variables[$key] = $value;
}
public function __get($key)
{
if (!array_key_exists($key, $this->_variables)) {
trigger_error("xtemplate::__get(): property <i>$key</i> does not exist", E_USER_NOTICE);
return null;
}
return $this->_variables[$key];
}
public function display($template)
{
if (!is_readable($template)) {
trigger_error("xtemplate::display(): template file <i>$template</i> is not readable", E_USER_NOTICE);
return null;
}
include $template;
}
}Code: Select all
<?php foreach ((array) $this->feeds as $item):?>so long
Rupo