I'm trying to make a application with Silex and I want to create a form wich will allow to add things in my database.
I added Symfony's components but I don't find documentation to create this kind of form, only connect forms. How can i do to use Symfony's components like :
$data = $form->getData(); $app['form']->persist($data); $app['form']->flush(); return $app->redirect($app['url_generator']->generate('homepage'));
Or should I do something like that ?
$data = $form->getData(); $sql = "INSERT INTO `testdb`.`video` (`id` ,`titre`) VALUES (NULL , $data['name']"; $app['dbs']['mysql_write']->execute($sql);
Thanx for your help.