Skip to content

Instantly share code, notes, and snippets.

@garak
Created Jan 9, 2012
Embed
What would you like to do?
/**
* @Route("/search/prova")
* @Template()
* @return array
*/
public function provaAction()
{
$form = $this->createFormBuilder()
->add('type', 'choice', array('required' => false, 'choices' => array(
'' => '',
'uno' => '1',
'due' => '2',
'tre' => '3',
)))->getForm();
$vars = array('form' => $form->createView(), 'res' => array());
if ($request->getMethod() == 'POST') {
$form->bindRequest($request);
if ($form->isValid()) {
$data = $form->getData();
$repo = $this->getDoctrine()->getRepository('GarakGarakBundle:stocazzo');
$vars['cards'] = $repo
->createQueryBuilder('c')
->getQuery()
->getResult();
}
}
return $vars;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment