久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <small id='CWn9b'></small><noframes id='CWn9b'>

      <legend id='CWn9b'><style id='CWn9b'><dir id='CWn9b'><q id='CWn9b'></q></dir></style></legend>
        <bdo id='CWn9b'></bdo><ul id='CWn9b'></ul>
      <tfoot id='CWn9b'></tfoot>

      <i id='CWn9b'><tr id='CWn9b'><dt id='CWn9b'><q id='CWn9b'><span id='CWn9b'><b id='CWn9b'><form id='CWn9b'><ins id='CWn9b'></ins><ul id='CWn9b'></ul><sub id='CWn9b'></sub></form><legend id='CWn9b'></legend><bdo id='CWn9b'><pre id='CWn9b'><center id='CWn9b'></center></pre></bdo></b><th id='CWn9b'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CWn9b'><tfoot id='CWn9b'></tfoot><dl id='CWn9b'><fieldset id='CWn9b'></fieldset></dl></div>

      什么是 baseUrl

      What exactly is a baseUrl(什么是 baseUrl)
      1. <tfoot id='5CamU'></tfoot>

          <legend id='5CamU'><style id='5CamU'><dir id='5CamU'><q id='5CamU'></q></dir></style></legend>

                <bdo id='5CamU'></bdo><ul id='5CamU'></ul>
                <i id='5CamU'><tr id='5CamU'><dt id='5CamU'><q id='5CamU'><span id='5CamU'><b id='5CamU'><form id='5CamU'><ins id='5CamU'></ins><ul id='5CamU'></ul><sub id='5CamU'></sub></form><legend id='5CamU'></legend><bdo id='5CamU'><pre id='5CamU'><center id='5CamU'></center></pre></bdo></b><th id='5CamU'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5CamU'><tfoot id='5CamU'></tfoot><dl id='5CamU'><fieldset id='5CamU'></fieldset></dl></div>
                  <tbody id='5CamU'></tbody>
              • <small id='5CamU'></small><noframes id='5CamU'>

              • 本文介紹了什么是 baseUrl的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我花了一些時(shí)間試圖理解 baseUrl 是什么(從學(xué)習(xí) Zend Framework 開(kāi)始),但令人驚訝的是,對(duì)于這樣一個(gè)無(wú)處不在的實(shí)用程序,沒(méi)有一個(gè)專(zhuān)家"或博主甚至試圖定義 baseUrl 以便學(xué)習(xí)者一個(gè)想法它是關(guān)于什么的.他們都假設(shè)你知道它是什么,然后繼續(xù)推導(dǎo)它,每個(gè)人都用自己的方法得出自己的結(jié)果.從我目前閱讀的內(nèi)容來(lái)看:

                有些人認(rèn)為它是 Homepage-Url,我自然會(huì)認(rèn)為它是(從名稱(chēng)中暗示的),可以通過(guò) $_SERVER["HTTP_HOST"]$_SERVER["SERVER_NAME"] 但令人驚訝的是這些似乎是少數(shù).

                有些人認(rèn)為這是一個(gè)當(dāng)前頁(yè)面,可以通過(guò) $_SERVER["REQUEST_URI"]$_SERVER["PHP_SELF"] 附加到 server-name 來(lái)訪問(wèn)>

                而其他人認(rèn)為它可以是上述任何內(nèi)容或任何 url(嗯,至少這是我得到的印象),這取決于用戶希望如何使用它.

                所以有人可以準(zhǔn)確解釋 baseUrl 是什么,而不假設(shè)我也是專(zhuān)家"以及為什么我可能需要它.謝謝.

                baseUrl 應(yīng)該在大多數(shù) Zend 項(xiàng)目上自動(dòng)設(shè)置,但在我的情況下顯然不是.即使我執(zhí)行 echo $this->baseUrl()var_dump($this->baseUrl()),我也一無(wú)所獲.所以我真的不知道這個(gè)實(shí)用程序是關(guān)于什么的.

                解決方案

                為什么需要 baseUrl() 工具的簡(jiǎn)短答案是:

                應(yīng)用的部署位置應(yīng)該是配置問(wèn)題,而不是核心應(yīng)用功能問(wèn)題

                在許多 - 甚至大多數(shù) - 情況下,應(yīng)用程序的 base-url 將只是 $_SERVER['HTTP_HOST']$_SERVER['SERVER_NAME']>.

                但情況并非總是如此.

                最容易考慮的例子是具有常用頁(yè)面的標(biāo)準(zhǔn)網(wǎng)站:

                • http://example.com/
                • http://example.com/contact
                • http://example.com/about
                • //等

                現(xiàn)在您編寫(xiě)(或購(gòu)買(mǎi)或下載為 OSS 包)一個(gè)要部署在 url 下的博客應(yīng)用程序:

                http://example.com/blog

                該博客可能有以下鏈接:

                • http://example.com/blog/post/my-post-slug
                • http://example.com/blog/categories/some-category
                • //etc

                所有這些鏈接都位于 /blog 下.

                博客應(yīng)用程序本身應(yīng)該關(guān)注博客內(nèi)的鏈接/頁(yè)面/路由.盡管您的博客模板很可能包含返回站點(diǎn)其余部分的頁(yè)眉/頁(yè)腳鏈接,但核心博客應(yīng)用程序的其余部分不必了解您站點(diǎn)的其余部分.不知何故,博客應(yīng)用程序需要知道,當(dāng)他生成指向博客文章和博客類(lèi)別以及所有其他與博客相關(guān)的頁(yè)面的鏈接時(shí),它們都必須以 http://example.com/blog 為前綴.

                $_SERVER['HTTP_HOST']$_SERVER['SERVER_NAME'] 不反映此環(huán)境/部署信息.使用 base-url 值配置 (!) 應(yīng)用程序并在生成鏈接時(shí)始終使用某種 baseUrl() 函數(shù)(使用此配置)是保持核心應(yīng)用程序功能專(zhuān)注的好方法自己的業(yè)務(wù),而不是外部部署因素.

                I have spent sometime trying to understand what a baseUrl is(from learning Zend Framework), but it's surprising that for such a ubiquitous utility, not a single "expert" or blogger has even attempted to define baseUrl so that a learner has an idea what it is about. They all assume you know what it is and then proceed to derive it, each one employing his own method to arrive at his own result. From what I'd read so far:

                Some think it is a Homepage-Url, which is what I'd naturally think it is(as implied from the name), to be accessed by $_SERVER["HTTP_HOST"] or $_SERVER["SERVER_NAME"] but surprisingly these seem to be in the minority.

                Some think it is a current page to be accessed by $_SERVER["REQUEST_URI"] or $_SERVER["PHP_SELF"] appended to server-name

                while others think it can be any of the above or any url for that matter(well, at least that's the impression I get), depending on how the user wants to use it.

                So can someone please explain exactly what a baseUrl is, without assuming I'm also "expert" and why I might need it. Thank you.

                EDIT: The baseUrl is supposed to be automatically set on most Zend projects, but apparently not in my case. Even when I do an echo $this->baseUrl() or var_dump($this->baseUrl()), I get nothing. So I really have no idea what this utility is about.

                解決方案

                The short answer for why you need to have a baseUrl() facility is this:

                Where the app is deployed should be a configuration issue, not a core application-functionality issue

                In many - perhaps even most - cases, the base-url of the application will simply be $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME'].

                But that's not always the case.

                The easiest example to consider is a standard website that has the usual pages:

                • http://example.com/
                • http://example.com/contact
                • http://example.com/about
                • // etc

                Now you write (or buy or download as an OSS package) a blog application that you would like to deploy under the url:

                http://example.com/blog

                The blog could have links like:

                • http://example.com/blog/post/my-post-slug
                • http://example.com/blog/categories/some-category
                • //etc

                All these links reside under /blog.

                The blog application itself should be concerned only with links/pages/routing inside the blog. Though your blog templates may very well contain header/footer links back to the rest of the site, the rest of the core blog application functionality should not have to know about of the rest of your site. Somehow, the blog application needs to know that when he generates links to blog posts and blog categories and all his other blog-related pages, they all must be prefixed with http://example.com/blog.

                The values $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME'] do not reflect this environment/deployment information. Configuring (!) the app with a base-url value and consistently using some kind of baseUrl() function (that consumes this config) when generating links is a good way to keep your core application functionality focused on its own business and not on external deployment factors.

                這篇關(guān)于什么是 baseUrl的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)

                <small id='kf5IS'></small><noframes id='kf5IS'>

                      <legend id='kf5IS'><style id='kf5IS'><dir id='kf5IS'><q id='kf5IS'></q></dir></style></legend>
                    • <tfoot id='kf5IS'></tfoot>
                        <bdo id='kf5IS'></bdo><ul id='kf5IS'></ul>
                        <i id='kf5IS'><tr id='kf5IS'><dt id='kf5IS'><q id='kf5IS'><span id='kf5IS'><b id='kf5IS'><form id='kf5IS'><ins id='kf5IS'></ins><ul id='kf5IS'></ul><sub id='kf5IS'></sub></form><legend id='kf5IS'></legend><bdo id='kf5IS'><pre id='kf5IS'><center id='kf5IS'></center></pre></bdo></b><th id='kf5IS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kf5IS'><tfoot id='kf5IS'></tfoot><dl id='kf5IS'><fieldset id='kf5IS'></fieldset></dl></div>
                            <tbody id='kf5IS'></tbody>

                        • 主站蜘蛛池模板: 亚洲一区成人 | 色婷婷在线视频 | 日韩在线中文字幕 | 亚洲 中文 欧美 日韩 在线观看 | 精品成人免费一区二区在线播放 | 久久久国产一区二区三区四区小说 | 国产精品视频在线播放 | 国产欧美一区二区三区日本久久久 | 精品一区久久 | 波多野结衣一区二区三区 | 亚洲天堂色 | 亚洲欧洲中文 | 欧美一级片免费看 | 免费观看一级特黄欧美大片 | 开操网| 国产人成在线观看 | 成人精品视频 | 久久亚洲美女 | 成人在线观看免费视频 | 欧美二区乱c黑人 | 视频在线一区 | 在线免费看毛片 | 成人在线电影网站 | 一区二区三区精品视频 | 国内精品在线视频 | 日韩精品在线一区 | 久久久久国产精品一区三寸 | a在线观看 | 不卡一区 | 国产伦精品一区二区三区精品视频 | 日韩精品人成在线播放 | 日韩中文一区 | 国产探花在线精品一区二区 | 中文字幕在线视频观看 | 精品国产91乱码一区二区三区 | 国产精品久久精品 | 美日韩精品 | 久久伦理电影 | 日日干天天操 | 久久久国产一区二区三区四区小说 | 免费看片国产 |