Zend search form
I have created a form w开发者_运维百科ithin the layout which is intended to be used across the site as a search box - The problem is that whenever the form is submitted the request string is appended to the existing URL
Any help in this regard will be appreciated
Regards, Bert
I think your problem is the "setAction" Method, because it is missing your baseUrl!.
If you want to submit your request with GET Method try this:
$view = $this->getView();
$baseUrl = $view->baseUrl();
$this->setAction($baseUrl . '/categorey/listproducts');
If you want to submit your request with POST Method try this:
$view = $this->getView();
$baseUrl = $view->baseUrl();
$this->setAction($baseUrl . '/categorey/listproducts');
$this->setMethod('POST');
Altough you could override the "setAction" Method from Zend_Form and set baseUrl to your action by default.
精彩评论