本文整理汇总了PHP中Zend_View::navigation方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View::navigation方法的具体用法?PHP Zend_View::navigation怎么用?PHP Zend_View::navigation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View
的用法示例。
在下文中一共展示了Zend_View::navigation方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sidebarMenu
function sidebarMenu()
{
$config = new Zend_Config_Xml(APPLICATION_PATH . '/modules/admin/configs/sidebar.xml', 'sidebar');
$container = new Zend_Navigation();
$container->setPages($config->toArray());
$view = new Zend_View();
echo $view->navigation($container)->menu()->setMaxDepth(1)->render();
}
示例2: navbarMainMenu
function navbarMainMenu()
{
$config = new Zend_Config_Xml(APPLICATION_PATH . '/modules/admin/configs/navbar.xml', 'main');
$container = new Zend_Navigation();
$container->setPages($config->toArray());
$view = new Zend_View();
echo $view->navigation($container)->menu()->setUlClass('nav navbar-nav')->setMaxDepth(0)->render();
}
示例3: getFull
/**
* Полностью раскрытое дерево
*
* @return Zend_View_Helper_Navigation_Menu
*/
private function getFull()
{
$menu = $this->_view->navigation()->menu($this->_categories);
if (isset($this->_options['showindex']) && $this->_options['showindex'] == 'no') {
$menu->setMinDepth(1)->setMaxDepth(null);
} else {
$menu->setMinDepth(null)->setMaxDepth(null);
}
return $menu;
}
示例4: preDispatch
/**
* Initialise the navigation system
*
* (non-PHPdoc)
* @see Zend_Controller_Plugin_Abstract::preDispatch()
*/
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
// If we are on the error controller, return immediately to prevent
// any database errors happening on error page
if ($request->controller == "error") {
return;
}
$nav = array();
if ($this->_view->logged_in) {
// Always add home link
$nav[] = array("label" => "Home", "id" => "home-link", "uri" => "/home");
// If we're in a project, add in the things you can do
if ($project_slug = $request->getParam("project")) {
$projects = new GD_Model_ProjectsMapper();
$project = $projects->getProjectBySlug($project_slug);
if ($project instanceof GD_Model_Project) {
$nav[] = array("label" => "History", "id" => "deployments-link", "uri" => "/project/{$project_slug}/history");
$nav[] = array("label" => "Settings", "id" => "settings-link", "uri" => "/project/{$project_slug}/settings");
$nav[] = array("label" => "Deploy", "id" => "deploy-link", "uri" => "/project/{$project_slug}/deploy");
}
} else {
$nav[] = array("label" => "Profile", "id" => "profile-link", "uri" => "/profile");
// Get the logged in user - if they're an admin, add the admin
// menu
$user = GD_Auth_Database::GetLoggedInUser();
if ($user->isAdmin()) {
$nav[] = array("label" => "Admin", "id" => "admin-link", "uri" => "/admin");
}
}
} else {
$nav[] = array("label" => "Login", "id" => "login-link", "uri" => "/auth/login");
}
// Create a Zend_Navigation object from the above array
$nav = new Zend_Navigation($nav);
$this->_view->navigation($nav);
// This finds out if the current URL matches one of the menu items
// and sets the active page if it does.
$uri = $request->getRequestUri();
$page = $this->_view->navigation()->findOneBy("uri", $uri);
if ($page) {
$page->setActive();
}
}
示例5: navbarRightMenu
function navbarRightMenu()
{
$config = new Zend_Config_Xml(APPLICATION_PATH . '/modules/admin/configs/navbar.xml', 'nav');
$container = new Zend_Navigation();
$container->setPages($config->toArray());
/*$container->addPage(
array(
'label' => Zend_Auth::getInstance()->getIdentity()->email,
'title' => 'Dashboard',
'uri' => '/admin/'
));*/
$view = new Zend_View();
echo $view->navigation($container)->menu()->setUlClass('dropdown-menu')->render();
}
示例6: _initView
public function _initView()
{
$view = new Zend_View();
$view->doctype('XHTML1_STRICT');
$view->env = APPLICATION_ENV;
$config = new Zend_Config_Xml(APPLICATION_PATH . "/configs/menu.xml", "nav");
$nav = new Zend_Navigation($config);
$view->navigation($nav);
$render = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$render->setView($view);
/*
$c = $nav->findAllByController('index');
$a = $nav->findAllByAction("index");
$found = array_intersect($c, $a);
*/
return $view;
}
示例7: Menu
///////////////////////////////////////////////////////////////////////////////
$view = new Zend_View();
$view->registerHelper(new Menu(), 'menu');
///////////////////////////////////////////////////////////////////////////////
?>
<html>
<head>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" />
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<?php
echo $view->navigation($demoMenu)->menu()->setMinDepth(1)->setMaxDepth(-1)->setRenderParents(false)->setUlClass('nav');
?>
</div>
</div>
</div>
<?php
echo $view->navigation($demoMenu)->menu()->setMinDepth(1)->setMaxDepth(1)->setUlClass("nav nav-list")->setRenderParents(false);
?>
<script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/jquery.js"></script>
<script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js"></script>
</body>
</html>
示例8: navMenu
function navMenu($container)
{
$view = new Zend_View();
return $view->navigation($container)->menu();
}