Issues

ZF-4387: Use Controller_Front's baseUrl

Issue Type: Patch Created: 2008-09-26T04:52:37.000+0000 Last Updated: 2008-12-01T13:50:45.000+0000 Status: Resolved Fix version(s): - 1.7.1 (01/Dec/08)

Reporter: Aspra Flavius Adrian (flavious) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Controller

Related issues: - ZF-2822

Attachments:

Description

Zend_Form::setAction($this->_helper->url(...)) and other components relying on Zend/Controller/Action/Helper/Url.php get wrong URLs when Zend_Controller_Front::setBaseUrl() is used.

I've noticed this in a modularized directory layout when setting form's action. I was unable to continue developing in my environment without this fix.

Please review, and explain me if something is wrong with the patch, as I've been using ZF only for three days now.

Regards, Flavius Aspra -- The diff --- library/Zend/Controller/Action/Helper/Url.php (revision 11520) +++ library/Zend/Controller/Action/Helper/Url.php (working copy) @@ -56,10 +56,12 @@

     if (null === $module) {
         $module = $request->getModuleName();
  • } + }

  • $fc = $this->getFrontController();

  • $url = $controller . '/' . $action;

  • if ($module != $this->getFrontController()->getDispatcher()->getDefaultModule()) {

  • if ($module != $fc->getDispatcher()->getDefaultModule()) { $url = $module . '/' . $url; }

@@ -72,7 +74,7 @@ $url .= '/' . $paramString; }

  • $url = '/' . ltrim($url, '/');

  • $url = '/' . ltrim($fc->getBaseUrl() . '/' . $url, '/');

    return $url;

}

Comments

Posted by Luiz Fernando Furtado (kgbfernando) on 2008-10-23T20:45:57.000+0000

Same ZF-2822

Posted by Wil Sinclair (wil) on 2008-12-01T13:50:45.000+0000

Updating these issues to mark them resolved for 1.7.1.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts