Created
June 13, 2011 22:57
-
-
Save j/1023949 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
<?php | |
[...] | |
// process form | |
if ('POST' == $this->request->getMethod()) { | |
// bind form data | |
$form->bindRequest($this->request); | |
// If form is valid | |
if ($form->isValid() && ($creative = $form->getData()) instanceOf Creative) { | |
$this->entityManager->persist($creative); | |
$this->entityManager->flush(); | |
$this->get('session')->setFlash('notice', 'Successfully added creative to <strong>' . $offer->getName() . '</strong>!'); | |
return $this->redirect($this->generateUrl('offer_creative', array('id' => $offer->getId()))); | |
} | |
} | |
[...] |
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 | |
[...] | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder | |
->add('name') | |
->add('description') | |
->add('html', 'textarea') | |
->add('active'); | |
} | |
[...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment