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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 生成url ### 方法生成 可以對路由進行映射生成 該方法首先會在路由規則里面尋找是否有符合規則的 如果沒有符合那么它將直接調用u方法生成url ~~~ Url::build();進行url的生成 /** * 生成url * @param [type] $expression [地址表達式] * @param string $params [參數] * @param string $ext [后綴] * @param string $domain [域名] * @return [type] [description] */ public function build($expression, $params = '', $ext = '', $domain = '') ~~~ 地址表達式會使用`parse_url`進行解析,所有可以在表達式上面加上域名參數錨點 例如: ~~~ Url::build('http://www.puaok.com/index/index/index', ['aid'=>3,'page'=>2], '.html') ~~~ 生成結果 ~~~ http://www.puaok.com/hepps/public/en/index/index/index/aid/3/page/2.html ~~~ 如果在地址表達式中帶域名必須要加`http://`或者`https://` #### 入口文件 在不是偽靜態的情況下需要在地址上面加有入口文件,默認的入口文件是`__ROOT__.index.php` 如需要修改可以使用root方法 ~~~ Url::root(__ROOT__.'other.php') ~~~ ### u函數生成 u函數生成不依賴與路由規則,僅僅會根據當前的配置的規則進行生成,使用方法和`build`方法一樣,不過在最后面多了一個參數,默認入口文件是`__ROOT__.index.php`,可以在最后一個參數上面加上入口文件 ~~~ /** * 生成url * @param [type] $expression [地址表達式] * @param array $params [參數] * @param string $ext [后綴名稱] * @param [type] $domain [域名] * @param [type] $root [入口文件] * @return [type] [description] */ function u($expression, $params = [], $ext = '', $domain = '', $root = __ROOT__ . 'index.php') ~~~ ### 快速創建url 一般情況下我們對url方法調用非常的頻繁,因為如果是文章列表之類的,如果使用u函數或者build方法生成會有很大的效率問題。 在url類型一樣僅僅參數不一致時使用次方法可獲得效率提升 #### 創建url 調用`Url::create()`方法創建一個url對象 參數: ~~~ [ 必填 pathinfo模式或者兼容模式下的url地址 'pathinfoMode'=>'', 必填普通模式下的url地址 'normalMode'=> '', 選填 url后綴 如果是bool值則獲取配置項的后綴,如果是字符串就使用該參數,否則后綴為空 'ext'=>true, 選填根路徑默認為__ROOT__.'index.php' 'root'=>'', 選填 域名 http:://www.puaok.com 或者www.puaok.com 'domain'=>'' ] ~~~ 示例: ~~~ $urlObj = Url::create([ 'pathinfoMode'=>'thread-{aid}-{page}', 'normalMode'=>ltrim(strstr(u('index/index/index', ['aid'=>'{aid}','page'=>'{page}']), '?'), '?'), 'ext'=>'.html', 'domain'=>'localhost']); ~~~ 該方法返回一個對象 url參數使用占位符{}進行占位 #### 生成url 在使用create獲取的對象可以直接調用 調用時可以傳入參數 ~~~ /** * 生成url * @param array $params [通過使用create方法調用] * @return [type] [description] */ public function __invoke(array $params = []) ~~~ 示例: ~~~ $urlObj(['aid'=>3,'page'=>1]); 結果:http://localhost/hepps/public/thread-3-1.html ~~~
                  <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>

                              哎呀哎呀视频在线观看