I need to set the object variable at run time, it is working, but PHP returns me:
Creating default object from empty value (/sct/fw FW_List.class.php:1142)
function initTemplates(&$object, $tpl_names)
{
global $FW_LIST_CONFIGURATION;
$is_custom = array();
foreach($tpl_names as $tpl_type) {
$object->$tpl_type = new template();
$object->$tpl_type->setTemplateText($FW_LIST_CONFIGURATION["templates"][$tpl_type]);
// place the defauts template values
$object->$tpl_type->setPlace( $FW_LIST_CONFIGURATION["css"][$tpl_type]);
}
return $is_custom;
}
ps. i can't use $object = new stdClass
, because $object is a pointer.
$object
could be a pointer? 2. Since PHP5 all objects are by default passed by reference, so you should omit&
. 3. You're using undefined variables$stdObj
and$$FW_LIST_CONFIGURATION
.