<bdo id='xsdHt'></bdo><ul id='xsdHt'></ul>
    1. <legend id='xsdHt'><style id='xsdHt'><dir id='xsdHt'><q id='xsdHt'></q></dir></style></legend>
      1. <small id='xsdHt'></small><noframes id='xsdHt'>

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

        Zend Framework $this->baseUrl() 总是返回当前页面 :

        时间:2023-10-02
          <tbody id='yORyX'></tbody>

          • <bdo id='yORyX'></bdo><ul id='yORyX'></ul>
            <legend id='yORyX'><style id='yORyX'><dir id='yORyX'><q id='yORyX'></q></dir></style></legend>

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

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

                  本文介绍了Zend Framework $this->baseUrl() 总是返回当前页面 :( 为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  查看本网站 www.fltdata.com.出于某种原因,无论您访问哪个页面,主页链接都不是指向主页,而是指向当前页面.它在我的本地主机上运行良好,但在网上它的行为是这样的.主页链接的 href 值就是:$this->baseUrl()

                  check out this website www.fltdata.com. For some reason the home link no matter what page you go on instead of pointing to the home page it points to the current page. It works fine on my localhost but online its behaving like this. The href value of the home link is just : $this->baseUrl()

                  这里有什么问题..

                  === 编辑===

                  好吧,我创建了一个助手,如下所示:

                  Well I have created a helper which is as below:

                  class Zend_View_Helper_BaseUrl
                  {
                      protected $_baseUrl;
                  
                      function __construct()
                      {
                          $fc = Zend_Controller_Front::getInstance();
                          $this->_baseUrl =  $fc->getBaseUrl();
                      }
                  
                      function baseUrl()
                      {
                          return $this->_baseUrl;
                      }
                  }
                  

                  这是我猜每当我调用 $this->baseUrl 时会调用什么.这可能是问题所在 - 但是它在我的本地主机上运行正常,而不是在线,所以 - 一定是某种配置问题 - 我应该在哪里查看?

                  ANd this is I guess whats being called whenever I call $this->baseUrl. Could this be the problem - however it works okay in my localhost and not online so - must be some kind of configuration issue - where should I look?

                  推荐答案

                  如果不了解有关 ZF 设置和 e.h. 的更多详细信息,就很难判断这里出了什么问题.url 重写设置.Zend_Controller_Request_Http::getBaseUrl() 背后的逻辑 - 如果没有 baseUrl,您对 Zend_View_Helper_BaseUrl::baseUrl() 的调用将被代理到在前端控制器中显式设置 - 非常复杂,涉及 4 个不同的服务器变量(在确定当前请求 URI 的过程中还有一些).

                  It's hard to tell what's going wrong here without knowing more details about your ZF setup and e.h. the url-rewriting-setup. The logic behind Zend_Controller_Request_Http::getBaseUrl() - this is where your call to Zend_View_Helper_BaseUrl::baseUrl() will beproxied to if no baseUrl is set explicitly in the front-controller - is quite complex and involves 4 different server variables (and some more in the process of determining the current request URI).

                  克服这个问题最简单的方法可能是在引导程序的前端控制器上设置 baseUrl(相对于服务器根目录).如果你正在使用新的 Zend_Application-bootstrapping 你只需要添加

                  The easiest thing to overcome this problem would perhaps be to set the baseUrl (relative to the server root) on the front-controller in your bootstrap. If you're using the new Zend_Application-bootstrapping you'll just have to add

                  resources.frontController.baseUrl = "/subdir"
                  

                  到您的配置.

                  编辑

                  您的助手或多或少类似于 ZF 附带的原始 baseUrl-helper.原始的也代理 Zend_Controller_Front::getBaseUrl().您使用哪个版本的 ZF?您是否有理由不使用随附的 baseUrl-helper?

                  Your helper more or less resembles the original baseUrl-helper shipped with the ZF. The original one also proxies to Zend_Controller_Front::getBaseUrl(). Which version of ZF do you use? Is there a reason why you don't use the shipped baseUrl-helper?

                  您是否尝试过在引导程序中明确设置 baseUrl?

                  Have you tried to set the baseUrl in your bootstrapping explicitly?

                  这篇关于Zend Framework $this->baseUrl() 总是返回当前页面 :( 为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Wamp 服务器:多个虚拟主机在 Windows 上不工作 下一篇:如何使用zend框架获取像mydomain.com/username这样的动

                  相关文章

                  最新文章

                  • <bdo id='k9Tam'></bdo><ul id='k9Tam'></ul>

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

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

                    <legend id='k9Tam'><style id='k9Tam'><dir id='k9Tam'><q id='k9Tam'></q></dir></style></legend>
                    1. <tfoot id='k9Tam'></tfoot>