Created
January 9, 2012 16:28
-
-
Save garak/1583690 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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