Hi Greg,
I would override the method - something simple like:
public function setAction($action)
{
$url = rtrim($this->getBaseUrl(), '/') .$action;
parent::setAction($url);
}
Then add a small helper method to abstract fetching the actual baseUrl (so you
can switch retrieval methods without meddling in setAction()).
Best regards,
Paddy
P.S. I'll add this to the next addendum if you wish?
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com
OpenID Europe Foundation
----- Original Message ----
From: Greg Freeman <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Sunday, June 8, 2008 7:53:23 AM
Subject: [fw-core] base url with zend_form::setAction
What is the best way to have zend_form::setAction use the base url set in the
front controller?
i.e If I'm making a form and set the form action like
$this->setAction('/user/login');
I would like the form action to be /baseurl/user/login
I don't really want to specify it for each form and I want to keep to dry
principles. Should I just subclass zend_form and overwrite the method?
--
View this message in context:
http://www.nabble.com/base-url-with-zend_form%3A%3AsetAction-tp17716135p17716135.html
Sent from the Zend Core mailing list archive at Nabble.com.