Created
October 26, 2012 09:47
-
-
Save sorbing/3957900 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
... | |
public function formAction(Request $request, $id) | |
{ | |
$task = new Task(); | |
if ($request->getMethod() == 'GET') | |
{ | |
$task->setTask('Новая задача'); | |
$task->setDueDate(new \DateTime('tomorrow')); | |
$tag_list = array('PHP 5.3', 'Symfony 2.1', 'Propel 1.6'); | |
$tags = array(); | |
foreach ($tag_list as $tag_name) | |
{ | |
$tag = new Tag(); | |
$tag->setTag($tag_name); | |
$task->addTag($tag); | |
} | |
} | |
$form = $this->createForm(new TaskType(), $task); | |
return $this->render('AppCommonBundle:Learning:form.html.twig', array( | |
'form' => $form->createView(), | |
)); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment