久久久久久久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>
                          • 主站蜘蛛池模板: 国产欧美一区二区精品久导航 | 亚洲免费人成在线视频观看 | 麻豆久久久9性大片 | 秋霞在线一区 | 国产激情精品一区二区三区 | 久久久久一区 | 久久久久国产精品一区 | 久久久资源| 欧美一区不卡 | 影音先锋中文在线 | 亚洲国产一区二区三区 | 亚洲一区二区不卡在线观看 | 午夜精品一区 | 欧美精品片 | 国产精品毛片一区二区在线看 | 久久精品小视频 | 亚洲精品免费在线 | 看片国产 | www.日韩欧美| 精品少妇一区二区三区日产乱码 | 九九久久免费视频 | 在线观看国产视频 | 亚洲国产免费 | 一级毛片视频 | 欧美视频在线看 | 亚洲高清成人在线 | av中文字幕在线播放 | 亚洲高清在线观看 | 欧美色综合网 | 日本精品一区二区三区视频 | 国产精品欧美一区二区三区 | 视频1区 | 欧美日韩在线观看一区 | 国产成人免费视频 | www.成人在线视频 | 日韩日b视频| 国产91久久久久蜜臀青青天草二 | av免费网站在线观看 | 日韩精品成人 | 国产伦精品一区二区三区照片91 | 亚洲一区av |