<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 類自動載入 ~~~ ?<?php ?/** ? * Created By basic ? * Author: Virus ? * Date: 2020/5/24 ? * Time: 13:14 ? */ ?? ?// 這里可以寫多個自動加載方法 ?spl_autoload_register('autoload1'); ?? ?function autoload1($class) ?{ ? ? ?require __DIR__.'/'.$class.'.php'; ?} ~~~ ## PSR-0規范 1. 命名空間必須與絕對路徑一致 2. 類名首字母必須大寫 3. 出入口文件外,其他“.php”必須只有一個類 > 一個簡易的PSR-0實現的框架目錄結構 ![PSR-0的簡易框架目錄雛形](file://D:/study/markdown%E6%96%87%E6%A1%A3/Java/image-20200524141212003.png?lastModify=1590310597) `index.php`入口文件 ~~~ ?<?php ?/** ? * Created By basic ? * Author: Virus ? * Date: 2020/5/24 ? * Time: 13:20 ? */ ?? ?// 定義基礎路徑 ?define('BASEDIR', __DIR__); ?? ?include BASEDIR.'/Base/Loader.php'; ?? ?spl_autoload_register('\\Base\\Loader::autoload'); ?? ?App\Controller\Home\Index::test(); ~~~ `Loader.php`加載類 ~~~ ?<?php ?/** ? * Created By basic ? * Author: Virus ? * Date: 2020/5/24 ? * Time: 13:24 ? */ ?namespace Base; ?class Loader ?{ ? ? ?public static function autoload($class) ? ? { ? ? ? ? ?// 需要將反斜杠換成斜杠 ? ? ? ? ?require BASEDIR.'/'.str_replace('\\', '/', $class).'.php'; ? ? } ?} ~~~ ## PHP的鏈式操作的實現 ~~~ ?<?php ?/** ? * Created By basic ? * Author: Virus ? * Date: 2020/5/24 ? * Time: 14:16 ? */ ?? ?namespace Base; ?? ?? ?class Database ?{ ? ? ?function where($where) ? ? { ? ? ? ? ?return $this; ? ? } ?? ? ? ?function order($order) ? ? { ? ? ? ? ?return $this; ? ? } ?? ? ? ?function limit($limit) ? ? { ? ? ? ? ?return $this; ? ? } ?} ~~~ ~~~ ?$db = new \Base\Database(); ?? ?// 傳統代碼步驟 ?//$db->where('id=1'); ?//$db->where("name=2"); ?//$db->order("id desc"); ?//$db->limit(10); ?? ?// 鏈式操作 ?$db->where("id=1")->where("name=2")->order("id desc")->limit(10); ~~~
                  <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>

                              哎呀哎呀视频在线观看