本文整理汇总了PHP中Zend_Navigation_Page::addPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Navigation_Page::addPage方法的具体用法?PHP Zend_Navigation_Page::addPage怎么用?PHP Zend_Navigation_Page::addPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Navigation_Page
的用法示例。
在下文中一共展示了Zend_Navigation_Page::addPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: treeToPageContainer
/**
* Recursively add pages to the container
*
* @param Zoo_Object_Tree $tree
* @param Zend_Navigation_Container $container
* @param int $key
* @return void
*/
function treeToPageContainer(&$tree, Zend_Navigation_Page $container, $key = 0)
{
$children = $tree->getFirstChild($key);
foreach ($children as $child) {
$page = $this->nodeToPage($child);
$container->addPage($page);
$this->treeToPageContainer($tree, $page, $child->id);
}
}
示例2: addInternalPage
/**
*
* @param Zend_Navigation_Page $pageParent
* @param Zend_Db_Table_Row_Abstract $menuItem
* @return Ambigous <Zend_Navigation_Page, Zend_Navigation_Page_Mvc, Zend_Navigation_Page_Uri, unknown>
*/
private function addInternalPage(Zend_Navigation_Page $pageParent, Zend_Db_Table_Row_Abstract $menuItem)
{
$options = array('id' => 'mii-' . $menuItem->id, 'label' => $menuItem->title, 'title' => $menuItem->title, 'target' => $menuItem->wtype, 'resource' => strtolower($menuItem->module . ':' . $menuItem->controller), 'privilege' => strtolower($menuItem->actioncontroller), 'order' => $menuItem->ordering, 'visible' => $menuItem->isvisible, 'class' => $menuItem->css_class, 'module' => $menuItem->module, 'controller' => $menuItem->controller, 'action' => $menuItem->actioncontroller);
$params = array();
$subItemsParams = Zend_Json::decode($menuItem->params);
if (!is_null($subItemsParams)) {
$params = $subItemsParams;
}
$page = Zend_Navigation_Page::factory($options);
$page->addParams($params);
$pageParent->addPage($page);
if (strlen($menuItem->id_alias) > 0) {
$page->setRoute($menuItem->id_alias);
} else {
$page->setRoute(strtolower($menuItem->module . '-' . $menuItem->controller . '-' . $menuItem->actioncontroller));
}
return $page;
}