<tfoot id='jEZUN'></tfoot>
        <bdo id='jEZUN'></bdo><ul id='jEZUN'></ul>
    1. <i id='jEZUN'><tr id='jEZUN'><dt id='jEZUN'><q id='jEZUN'><span id='jEZUN'><b id='jEZUN'><form id='jEZUN'><ins id='jEZUN'></ins><ul id='jEZUN'></ul><sub id='jEZUN'></sub></form><legend id='jEZUN'></legend><bdo id='jEZUN'><pre id='jEZUN'><center id='jEZUN'></center></pre></bdo></b><th id='jEZUN'></th></span></q></dt></tr></i><div id='jEZUN'><tfoot id='jEZUN'></tfoot><dl id='jEZUN'><fieldset id='jEZUN'></fieldset></dl></div>
    2. <small id='jEZUN'></small><noframes id='jEZUN'>

      <legend id='jEZUN'><style id='jEZUN'><dir id='jEZUN'><q id='jEZUN'></q></dir></style></legend>

        渲染没有顶层的 Zend Navigation 的活动分支

        Rendering Active Branch of Zend Navigation Without Top Level(渲染没有顶层的 Zend Navigation 的活动分支)
        <legend id='oLWqh'><style id='oLWqh'><dir id='oLWqh'><q id='oLWqh'></q></dir></style></legend>
        <i id='oLWqh'><tr id='oLWqh'><dt id='oLWqh'><q id='oLWqh'><span id='oLWqh'><b id='oLWqh'><form id='oLWqh'><ins id='oLWqh'></ins><ul id='oLWqh'></ul><sub id='oLWqh'></sub></form><legend id='oLWqh'></legend><bdo id='oLWqh'><pre id='oLWqh'><center id='oLWqh'></center></pre></bdo></b><th id='oLWqh'></th></span></q></dt></tr></i><div id='oLWqh'><tfoot id='oLWqh'></tfoot><dl id='oLWqh'><fieldset id='oLWqh'></fieldset></dl></div>

        <small id='oLWqh'></small><noframes id='oLWqh'>

            <tbody id='oLWqh'></tbody>
            <bdo id='oLWqh'></bdo><ul id='oLWqh'></ul>

                • <tfoot id='oLWqh'></tfoot>
                  本文介绍了渲染没有顶层的 Zend Navigation 的活动分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在一个地方渲染 Zend Navigation 对象的顶级元素,如下所示:

                  I am rendering the top-level elements of a Zend Navigation object in one place like this:

                  echo $this->navigation()->menu()->setMaxDepth(0);
                  

                  如何为活动分支呈现从第二级向下的导航树?我已经尝试创建一个循环 $this->container 对象的部分,但我不知道如何确定我的当前项目是否是活动分支.一旦我确定它是活动分支,我该如何呈现菜单?我这样做是不是很困难并且遗漏了一些明显的东西?

                  How do I render the navigation tree from the second level on down for the active branch? I've tried creating a partial that loops the $this->container object, but I don't know how to determine if my current item is the active branch. Once I've determined that it's the active branch how do I render the menu? Am I doing this the hard way and missing something obvious?

                  谢谢!

                  更新:

                  我接受了一个解决方案,因为这是我使用的解决方案,但我也想提供我的实际问题的答案,以供参考.($this 是视图对象)

                  I accepted a solution because that's what I used, but I also would like to provide the answer to my actual question, for reference sake. ($this is the view object)

                  // Find the active branch, at a depth of one
                  $branch = $this->navigation()->findActive($this->nav, 1, 1);
                  if (0 == count($branch)) {
                      // no active branch, find the default branch
                      $pages = $this->nav->findById('default-branch')->getPages();
                  } else {
                      $pages = $branch['page']->getPages();
                  }
                  $this->subNav = new Zend_Navigation($pages);
                  

                  $this->subNav 然后可用于呈现子菜单.

                  $this->subNav can then be used to render the sub-menu.

                  推荐答案

                  我做了类似的事情.我的主要导航是用这样的方式处理的...

                  I do something similar. My main navigation is handled with something like this...

                  $this->navigation()->menu()->setPartial('tabs.phtml');
                  echo $this->navigation()->menu()->render();
                  

                  然后在我的 tabs.phtml 中,我像这样遍历容器...

                  Then in my tabs.phtml I iterate over the container like so...

                  if (count($this->container)) {
                    foreach($this->container as $page) {
                      if ($page->isVisible()) {
                        if ($page->isActive(true)) {
                          $subcontainer = $page->getPages();
                          foreach($subcontainer as $subpage) {
                            // echo my link
                          }
                        }
                      }
                    }
                  }
                  

                  希望对你有所帮助.

                  这篇关于渲染没有顶层的 Zend Navigation 的活动分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    <small id='rBY1g'></small><noframes id='rBY1g'>

                  1. <legend id='rBY1g'><style id='rBY1g'><dir id='rBY1g'><q id='rBY1g'></q></dir></style></legend>
                      <tfoot id='rBY1g'></tfoot>
                      <i id='rBY1g'><tr id='rBY1g'><dt id='rBY1g'><q id='rBY1g'><span id='rBY1g'><b id='rBY1g'><form id='rBY1g'><ins id='rBY1g'></ins><ul id='rBY1g'></ul><sub id='rBY1g'></sub></form><legend id='rBY1g'></legend><bdo id='rBY1g'><pre id='rBY1g'><center id='rBY1g'></center></pre></bdo></b><th id='rBY1g'></th></span></q></dt></tr></i><div id='rBY1g'><tfoot id='rBY1g'></tfoot><dl id='rBY1g'><fieldset id='rBY1g'></fieldset></dl></div>
                            <bdo id='rBY1g'></bdo><ul id='rBY1g'></ul>
                              <tbody id='rBY1g'></tbody>