Thursday 09 November 2006 2:14:27 am
Hi, I'm experiencing the same problem as described in Dericks article "Reference Issues" (http://ez.no/community/articles/reference_issues), under the subheading "Problems with foreach() and Return by Reference." I'm using v. 3.8.4, and my code looks something like this:
include_once( "lib/ezxml/classes/ezdomdocument.php" );
// create dom document
$doc = new eZDOMDocument( 'Root' );
// root
$root =& $doc->createElementNode( "Root" );
$doc->setRoot( $root );
// for each order
$i++;
foreach($items as $item)
{
// order
$xmlItem = $doc->createElementNode( 'Order' );
// date and time
$dateTime =& $doc->createElementNode( 'DateTime' );
$dateTime->appendChild($doc->createTextNode( $i ));
$xmlOrder->appendChild($dateTime);
// append order to root
$root->appendChild($xmlItem);
$i++;
}
// return xml
return $doc->toString();
It this a bug in my code, or in eZ Publish, and what can I do to fix it? Thanks in advance !
Sincerely,
Eirik Alfstad Johansen
http://www.netmaking.no/
|