Now it works with
$request = Zend_Controller_Front::getInstance()->getRequest();
$param = $request->getParam($param);
$param = $request->getParam($param);
thanks Ruslan!
I can swear that is the first and most logical think I tried and didn't work... :)
Regards,
Saša Stamenković
On Mon, Oct 12, 2009 at 10:01 AM, Nick Pack <nick@nickpack.com> wrote:
umpirsky wrote:In your controller where you initiate your form you can call the populate() method, e.g.
Hi.
I have class which extends Zend_Form. What I want to do during elements
initialization is to assign default values to elements from the request. But
I cant reach getParam method from the form. Is there some elegant way to do
this (without passing all values to form constructor)?
public function IndexAction()
{
$request = $this->getRequest();
$form = new MyForm();
// $request->getParam('name');
// Sanitise params and assign them to array $values[]
$form->populate($values);
没有评论:
发表评论