Iam rendering a menu (using Zend framework) (zend_navigation)
what iam doing is getting the page as label if the page has the value "myPage" than then iam setting the new URI with the page as expected
$it = new RecursiveIteratorIterator(
$container, RecursiveIteratorIterator::SELF_FIRST);
foreach ($it as &$page) {
$label = $page->label;
if($label = "MyPage"){
$newuri = "mypage.php?stcode=".$stcode."&cde=".$cde;
$page->setUri($newuri);
}
}
In the above statement iam getting an error "An iterator cannot be used with foreach by reference". I want to use reference so that based on the label i can point the page to new uri
Now my problem and all the menu items in the menu are getting the same URI . i dont know what wrong iam doing