<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之旅 廣告
                >[danger]Container是App的父類 ## **屬性** ``` //new \think\App()->http;或者new \think\App()-make('http')實例化的類都會被保存在$instances屬性里 protected $instances ``` ## **方法** ~~~ //將實例化后的類保存進$instances屬性 注意:這里的 new \think\App()->instance('wechat', new \think\Wechat() ); ~~~ ### **容器標識:app、cache等都是存在App下的bind屬性里** ``` $app=new \think\App(); $app->app; $app->cache; $app->config; $app->console; $app->cookie; $app->db; $app->env; $app->event; $app->http; $app->lang; $app->log; $app->middleware; $app->request; $app->response; $app->route; $app->session; $app->validate; $app->view; $app->filesystem; $app->think\DbManager; $app->think\LogManager; $app->think\CacheManager; $app->Psr\Log\LoggerInterface;// 接口依賴注入 ``` >[info] `new \think\App()->http;`調用一個不存在的屬性則觸發繼承與Container的_get()魔術方法 > __get()魔術方法則調用Container的`get()`方法 > get()方法用`has()`方法判斷http標識或者Http類是否存在 > 存在則調用Container的`make()`方法 > make()方法進一步檢查instances屬性數組中是否含有http存在直接返回 > 不存在則調用bind屬性中是否有http標識有則實例化標識所對應的http類 > 在bind屬性的數組中未找到該標識則調用invokeClass 調用反射執行類的實例化 >[danger]由于__get方法的原因: > `$http = (new App())->make('http');` 等同于 `$http = (new App())->http;`
                  <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>

                              哎呀哎呀视频在线观看