Created
May 5, 2012 05:59
-
-
Save coreymcmahon/2600218 to your computer and use it in GitHub Desktop.
Using the Form class in a Controller - http://www.symfonycentral.com
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
<?php | |
use MyCompany\BlogBundle\Form\Type\ArticleType; | |
use MyCompany\BlogBundle\Entity\Article; | |
/* ... rest of the controller */ | |
/** | |
* @Route("/article/add", name="post_add") | |
* @Template() | |
*/ | |
public function addAction() | |
{ | |
$article = new Article(); | |
$form = $this->createForm(new ArticleType(), $article); | |
/* ... rest of the controller */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment