久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

      <tfoot id='iALJw'></tfoot>
      <i id='iALJw'><tr id='iALJw'><dt id='iALJw'><q id='iALJw'><span id='iALJw'><b id='iALJw'><form id='iALJw'><ins id='iALJw'></ins><ul id='iALJw'></ul><sub id='iALJw'></sub></form><legend id='iALJw'></legend><bdo id='iALJw'><pre id='iALJw'><center id='iALJw'></center></pre></bdo></b><th id='iALJw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iALJw'><tfoot id='iALJw'></tfoot><dl id='iALJw'><fieldset id='iALJw'></fieldset></dl></div>

        • <bdo id='iALJw'></bdo><ul id='iALJw'></ul>

      1. 在zend框架中調用其他控制器的成員函數?

        Calling member function of other controller in zend framework?(在zend框架中調用其他控制器的成員函數?)
          <tbody id='iunA2'></tbody>

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

          <tfoot id='iunA2'></tfoot>

          • <small id='iunA2'></small><noframes id='iunA2'>

            <i id='iunA2'><tr id='iunA2'><dt id='iunA2'><q id='iunA2'><span id='iunA2'><b id='iunA2'><form id='iunA2'><ins id='iunA2'></ins><ul id='iunA2'></ul><sub id='iunA2'></sub></form><legend id='iunA2'></legend><bdo id='iunA2'><pre id='iunA2'><center id='iunA2'></center></pre></bdo></b><th id='iunA2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iunA2'><tfoot id='iunA2'></tfoot><dl id='iunA2'><fieldset id='iunA2'></fieldset></dl></div>

                1. <legend id='iunA2'><style id='iunA2'><dir id='iunA2'><q id='iunA2'></q></dir></style></legend>
                  本文介紹了在zend框架中調用其他控制器的成員函數?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  是否可以在zend框架中調用另一個控制器的成員函數,如果是,那么如何?

                  Is it possible to call the member function of another controller in zend framework, if yes then how?

                  <?php
                  class FirstController extends Zend_Controller_Action {
                      public function indexAction() {
                           // general action 
                      }   
                  
                      public function memberFunction() {
                           // a resuable function
                      }
                  }
                  

                  這是另一個控制器

                  <?php
                  class SecondController extends Zend_Controller_Action {
                      public indexAction() {
                           // here i need to call memberFunction() of FirstController
                      }
                  }
                  

                  請解釋我如何從第二個控制器訪問 memberFunction().

                  Please explain how i can access memberFunction() from second controller.

                  更好的想法是定義一個 AppController 并使所有常用控制器擴展 AppController,從而進一步擴展 Zend_Controller_Action.

                  Better idea is to define a AppController and make all usual controllers to extend AppController which further extends Zend_Controller_Action.

                  class AppController extends Zend_Controller_Action {
                      public function memberFunction() {
                           // a resuable function
                      }
                  }
                  
                  class FirstController extends AppController {
                      public function indexAction() {
                           // call function from any child class
                           $this->memberFunction();
                      } 
                  }
                  

                  現在 memberFunction 可以從擴展 AppController 的控制器調用,作為簡單繼承的規則.

                  Now memberFunction can be invoked from controllers extending AppController as a rule of simple inheritance.

                  推薦答案

                  控制器并非旨在以這種方式使用.如果您想在當前控制器之后執行另一個控制器的動作,請使用_forward()方法:

                  Controllers aren't designed to be used in that way. If you want to execute an action of the other controller after your current controller, use the _forward() method:

                  // Invokes SecondController::otherActionAction() after the current action has been finished.
                  $this->_forward('other-action', 'second');
                  

                  請注意,這只適用于操作方法(memberAction"),不適用于任意成員函數!

                  Note that this only works for action methods ("memberAction"), not arbitrary member functions!

                  如果 SecondController::memberFunction() 做了一些跨多個控制器需要的事情,把代碼放在一個動作助手或庫類中,這樣兩個控制器就可以訪問共享的功能而不必依賴互相依賴.

                  If SecondController::memberFunction() does something that is needed across multiple controllers, put that code in a action helper or library class, so that both controllers can access the shared functionality without having to depend on each other.

                  這篇關于在zend框架中調用其他控制器的成員函數?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

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

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

                  1. <small id='eApe3'></small><noframes id='eApe3'>

                        • <i id='eApe3'><tr id='eApe3'><dt id='eApe3'><q id='eApe3'><span id='eApe3'><b id='eApe3'><form id='eApe3'><ins id='eApe3'></ins><ul id='eApe3'></ul><sub id='eApe3'></sub></form><legend id='eApe3'></legend><bdo id='eApe3'><pre id='eApe3'><center id='eApe3'></center></pre></bdo></b><th id='eApe3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eApe3'><tfoot id='eApe3'></tfoot><dl id='eApe3'><fieldset id='eApe3'></fieldset></dl></div>
                            <bdo id='eApe3'></bdo><ul id='eApe3'></ul>
                          • 主站蜘蛛池模板: 久久精品亚洲精品国产欧美kt∨ | av中文在线观看 | 久久成人一区二区三区 | 精品久久香蕉国产线看观看亚洲 | 精品国产网 | 紧缚调教一区二区三区视频 | 日日夜夜天天久久 | 国产精品日产欧美久久久久 | 国产91在线播放 | 成人影院一区二区三区 | 黄色小视频大全 | 国产精品揄拍一区二区 | 中文字幕a√ | 亚洲一区二区三区乱码aⅴ 四虎在线视频 | 日韩av免费看 | 国产激情视频在线观看 | 亚洲国产精品va在线看黑人 | 日日摸夜夜爽人人添av | 91久久 | 国产精品日韩在线 | 一级黄色绿像片 | 69电影网 | 麻豆久久久久久久久久 | 日朝毛片 | 天天综合网永久 | 久久99精品视频 | 日韩一级黄色片 | 香蕉91| 日韩福利| 中文字幕一区在线观看视频 | 一区中文字幕 | 色小姐综合网 | 午夜精品| 免费观看的av | 在线精品亚洲欧美日韩国产 | 免费a国产 | 亚洲精品日韩在线观看 | 久草青青草 | 国产精品福利一区二区三区 | 91精品国产综合久久国产大片 | 91麻豆精品国产91久久久资源速度 |