<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                Bootstrap, 也叫做引導程序. 它是Yaf提供的一個全局配置的入口, 在Bootstrap中, 你可以做很多全局自定義的工作. ### 使用Bootstrap 在一個Yaf_Application被實例化之后, 運行(Yaf_Application::run)之前, 可選的我們可以運行Yaf_Application::bootstrap #### 改寫index.php文件如下: `<?php define("APP_PATH", realpath(dirname(__FILE__))); $app = new Yaf_Application(APP_PATH . "/conf/application.ini"); $app->bootstrap()->run(); ` 當bootstrap被調用的時刻, Yaf_Application就會默認的在APPLICATION_PATH下, 尋找Bootstrap.php, 而這個文件中, 必須定義一個Bootstrap類, 而這個類也必須繼承自Yaf_Bootstrap_Abstract. 實例化成功之后, 所有在Bootstrap類中定義的, 以_init開頭的方法, 都會被依次調用, 而這些方法都可以接受一個Yaf_Dispatcher實例作為參數. 也可以通過在配置文件中修改application.bootstrap來變更Bootstrap類的位置. ### 簡單的示例Bootstrap.php `<?php class Bootstrap extends Yaf_Bootstrap_Abstract{ public function _initConfig() { $config = Yaf_Application::app()->getConfig(); Yaf_Registry::set("config", $config); } public function _initDefaultName(Yaf_Dispatcher $dispatcher) { $dispatcher->setDefaultModule("Index")->setDefaultController("Index")->setDefaultAction("index"); } }`
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看