request - Zend 2.x, setValue from url -


i want setvalue in form class depending on get request. set value in form sth :

class bookingform extends form {      $this->add(array(         'name' => 'end',         'type' => 'text',         'options' => array(             'label' => 'date to',         ),         'attributes' => array(             'value' => '2013-09-18 15:45',         ),     )); } 

but it's hard coded , want avoid this, there method $this->getrequest()->get('var extracted url') ??

i founded solution in :

class bookingcontroller extends abstractactioncontroller {      ...      $get = $request->getquery('start');      $get = str_replace('_', ' ', $get);      $form->get('start')->setvalue($get);      ...  } 

and that's all.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -