Friday, 11 June 2010

How to create query parameter in symfony?

There are two ways to make query parameters:

First Method:


$params = array(
    'name'    => $request->getParameter('name'),
    'email'   => $request->getParameter('email'),
    'message' => $request->getParameter('message'),
  );

http_build_query($params);

Second Method:

$this->form = new ContactForm();
http_build_query($this->form->getValues());


Cheers!

No comments:

Post a Comment