pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

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

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

        如何擴展 Zend Navigation Menu View Helper?

        How do I extend the Zend Navigation Menu View Helper?(如何擴展 Zend Navigation Menu View Helper?)
      1. <small id='z04j6'></small><noframes id='z04j6'>

      2. <i id='z04j6'><tr id='z04j6'><dt id='z04j6'><q id='z04j6'><span id='z04j6'><b id='z04j6'><form id='z04j6'><ins id='z04j6'></ins><ul id='z04j6'></ul><sub id='z04j6'></sub></form><legend id='z04j6'></legend><bdo id='z04j6'><pre id='z04j6'><center id='z04j6'></center></pre></bdo></b><th id='z04j6'></th></span></q></dt></tr></i><div class="u0228is" id='z04j6'><tfoot id='z04j6'></tfoot><dl id='z04j6'><fieldset id='z04j6'></fieldset></dl></div>
        <legend id='z04j6'><style id='z04j6'><dir id='z04j6'><q id='z04j6'></q></dir></style></legend>
          <bdo id='z04j6'></bdo><ul id='z04j6'></ul>

          <tfoot id='z04j6'></tfoot>

                <tbody id='z04j6'></tbody>
                  本文介紹了如何擴展 Zend Navigation Menu View Helper?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我需要更改Zend_View_Helper_Navigation_Menu 的輸出.我找到了需要修改的兩個函數(shù),并且知道如何進行所需的更改.我不知道如何讓 Navigation 對象使用我的視圖助手而不是 Zend .

                  I need to change the output of Zend_View_Helper_Navigation_Menu. I've found the two functions that I'll need to modify, and I know how to make the changes I need. What I don't know is how to make the Navigation object use my view helper instead of the Zend one.

                  代表我的類擴展的代碼片段:

                  Code snippet representing my class extension:

                  // file /library/My/View/Helper/Navigation/Menu.php
                  class My_View_Helper_Navigation_Menu extends Zend_View_Helper_Navigation_Menu
                  {
                      protected function _renderDeepestMenu(Zend_Navigation_Container $container,
                                                            $ulClass,
                                                            $indent,
                                                            $minDepth,
                                                            $maxDepth)
                      {
                          // modified code here
                      }
                  
                      protected function _renderMenu(Zend_Navigation_Container $container,
                                                     $ulClass,
                                                     $indent,
                                                     $minDepth,
                                                     $maxDepth,
                                                     $onlyActive)
                      {
                          // modified code here
                      }
                  }
                  

                  <小時>

                  編輯以澄清

                  我想更改

                1. 元素的類并刪除 EOL 和縮進.菜單視圖腳本沒有選項可以做到這一點,這就是我必須擴展它的原因.

                  I want to change the class of the <li> elements and remove the EOL and indentation. There are no options to do that with the menu view script, which is why I'll have to extend it.

                  在我的 Bootstrap 中初始化導(dǎo)航對象:

                  Initializing the navigation object in my Bootstrap:

                  $navTable = new Default_Model_Site_DbTable_Navigation();
                  $view = $this->getResource('view');
                  $view->navigation(new Zend_Navigation($navTable->getNavigation()));
                  

                  在我的布局中渲染菜單:

                  Rendering the menu in my layout:

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

                  <小時>

                  解決方案

                  我通過如下重命名使其工作,但我不清楚為什么我不能重載/覆蓋 _Menu 類和 menu() 函數(shù).

                  I got it working by renaming things as follows, but I am not clear on why I can't overload/overwrite the _Menu class and menu() function.

                  1. 將類名更改為My_View_Helper_Navigation_MyMenu
                  2. 在類中添加myMenu函數(shù)(return parent::menu($container);)
                  3. 在布局中調(diào)用echo $this->navigation()->myMenu();

                  類線框:

                  // file /library/My/View/Helper/Navigation/MyMenu.php
                  class My_View_Helper_Navigation_MyMenu extends Zend_View_Helper_Navigation_Menu
                  {
                      public function myMenu(Zend_Navigation_Container $container = null)
                      {
                          return parent::menu($container);
                      }
                  
                      protected function _renderDeepestMenu(Zend_Navigation_Container $container,
                                                            $ulClass,
                                                            $indent,
                                                            $minDepth,
                                                            $maxDepth)
                      {
                          // modified code here
                      }
                  
                      protected function _renderMenu(Zend_Navigation_Container $container,
                                                     $ulClass,
                                                     $indent,
                                                     $minDepth,
                                                     $maxDepth,
                                                     $onlyActive)
                      {
                          // modified code here
                      }
                  }
                  

                  推薦答案

                     $view->addHelperPath(
                        APPLICATION_ROOT . '/library/MyApp/View/Helper/Navigation',
                        'MyApp_View_Helper_'
                        );
                  
                  
                  echo $this->navigation()->myMenu(); // name of your class
                  

                  來自:讓 Zend_Navigation 菜單工作使用 jQuery 的魚眼

                  編輯

                  抱歉,我沒有看到您的解決方案,這正是我發(fā)布的內(nèi)容.

                  Sorry I've not seen your solution, it is exactly what I've posted.

                  但為什么這不是菜單類的真正擴展?

                  But why this is not a trully extension of menu class?

                  這篇關(guān)于如何擴展 Zend Navigation Menu View Helper?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!
                2. 相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)

                      <bdo id='caIux'></bdo><ul id='caIux'></ul>

                            <tbody id='caIux'></tbody>
                        • <small id='caIux'></small><noframes id='caIux'>

                        • <legend id='caIux'><style id='caIux'><dir id='caIux'><q id='caIux'></q></dir></style></legend>
                        • <i id='caIux'><tr id='caIux'><dt id='caIux'><q id='caIux'><span id='caIux'><b id='caIux'><form id='caIux'><ins id='caIux'></ins><ul id='caIux'></ul><sub id='caIux'></sub></form><legend id='caIux'></legend><bdo id='caIux'><pre id='caIux'><center id='caIux'></center></pre></bdo></b><th id='caIux'></th></span></q></dt></tr></i><div class="kqa2co2" id='caIux'><tfoot id='caIux'></tfoot><dl id='caIux'><fieldset id='caIux'></fieldset></dl></div>
                          <tfoot id='caIux'></tfoot>
                          • 主站蜘蛛池模板: 小型UV打印机-UV平板打印机-大型uv打印机-UV打印机源头厂家 |松普集团 | 臻知网大型互动问答社区-你的问题将在这里得到解答!-无锡据风网络科技有限公司 | 胜为光纤光缆_光纤跳线_单模尾纤_光纤收发器_ODF光纤配线架厂家直销_北京睿创胜为科技有限公司 - 北京睿创胜为科技有限公司 | 光泽度计_测量显微镜_苏州压力仪_苏州扭力板手维修-苏州日升精密仪器有限公司 | 免费个人pos机申请办理-移动pos机刷卡-聚合收款码办理 | 液压油缸-液压站生产厂家-洛阳泰诺液压科技有限公司 | 世界箱包品牌十大排名,女包小众轻奢品牌推荐200元左右,男包十大奢侈品牌排行榜双肩,学生拉杆箱什么品牌好质量好 - Gouwu3.com | 辽宁资质代办_辽宁建筑资质办理_辽宁建筑资质延期升级_辽宁中杭资质代办 | 成都中天自动化控制技术有限公司| 板材品牌-中国胶合板行业十大品牌-环保板材-上海声达板材 | 臻知网大型互动问答社区-你的问题将在这里得到解答!-无锡据风网络科技有限公司 | 面粉仓_储酒罐_不锈钢储酒罐厂家-泰安鑫佳机械制造有限公司 | 动力配电箱-不锈钢配电箱-高压开关柜-重庆宇轩机电设备有限公司 聚天冬氨酸,亚氨基二琥珀酸四钠,PASP,IDS - 远联化工 | 安平县鑫川金属丝网制品有限公司,防风抑尘网,单峰防风抑尘,不锈钢防风抑尘网,铝板防风抑尘网,镀铝锌防风抑尘网 | 聚合氯化铝-碱式氯化铝-聚合硫酸铁-聚氯化铝铁生产厂家多少钱一吨-聚丙烯酰胺价格_河南浩博净水材料有限公司 | 电缆接头_防水接头_电缆防水接头 - 乐清市新豪电气有限公司 | 高效复合碳源-多核碳源生产厂家-污水处理反硝化菌种一长隆科技库巴鲁 | 选矿设备-新型重选设备-金属矿尾矿重选-青州冠诚重工机械有限公司 | 电竞馆加盟,沈阳网吧加盟费用选择嘉棋电竞_售后服务一体化 | 广州展台特装搭建商|特装展位设计搭建|展会特装搭建|特装展台制作设计|展览特装公司 | 屏蔽服(500kv-超高压-特高压-电磁)-徐吉电气 | 吉祥新世纪铝塑板_生产铝塑板厂家_铝塑板生产厂家_临沂市兴达铝塑装饰材料有限公司 | 广州办公室设计,办公室装修,写字楼设计,办公室装修公司_德科 | 广州办公室设计,办公室装修,写字楼设计,办公室装修公司_德科 | 精密机械零件加工_CNC加工_精密加工_数控车床加工_精密机械加工_机械零部件加工厂 | 股指期货-期货开户-交易手续费佣金加1分-保证金低-期货公司排名靠前-万利信息开户 | 污水/卧式/潜水/钻井/矿用/大型/小型/泥浆泵,价格,参数,型号,厂家 - 安平县鼎千泵业制造厂 | 厌氧反应器,IC厌氧反应器,厌氧三相分离器-山东创博环保科技有限公司 | 即用型透析袋,透析袋夹子,药敏纸片,L型涂布棒-上海桥星贸易有限公司 | 南京雕塑制作厂家-不锈钢雕塑制作-玻璃钢雕塑制作-先登雕塑厂 | 传动滚筒,改向滚筒-淄博建凯机械科技有限公司 | 120kv/2mA直流高压发生器-60kv/2mA-30kva/50kv工频耐压试验装置-旭明电工 | 杭州可当科技有限公司—流量卡_随身WiFi_AI摄像头一站式解决方案 | 杭州成人高考_浙江省成人高考网上报名| 【直乐】河北石家庄脊柱侧弯医院_治疗椎间盘突出哪家医院好_骨科脊柱外科专业医院_治疗抽动症/关节病骨伤权威医院|排行-直乐矫形中医医院 | 咖啡加盟,咖啡店加盟连锁品牌-卡小逗 | 胀套-锁紧盘-风电锁紧盘-蛇形联轴器「厂家」-瑞安市宝德隆机械配件有限公司 | 高楼航空障碍灯厂家哪家好_航空障碍灯厂家_广州北斗星障碍灯有限公司 | RS系列电阻器,RK_RJ启动调整电阻器,RQ_RZ电阻器-上海永上电器有限公司 | HDPE土工膜,复合土工膜,防渗膜价格,土工膜厂家-山东新路通工程材料有限公司 | 山楂片_雪花_迷你山楂片_山楂条饼厂家-青州市丰源食品厂 |