Skip to content

Instantly share code, notes, and snippets.

@pjedrzejewski
Created February 25, 2011 17:20
Show Gist options
  • Save pjedrzejewski/844122 to your computer and use it in GitHub Desktop.
Save pjedrzejewski/844122 to your computer and use it in GitHub Desktop.
$form = $this->get('sylius.assortment.form.category');
$category = $this->get('sylius.assortment.manager')->createCategory();
$form->bind($this->get('request'), $category);
if ($form->isValid()) {
$this->get('sylius.assortment.manager')->addCategory($category);
return new RedirectResponse($this->get('router')->generate('homepage'));
}
return $this->render('SyliusAssortmentBundle:Category:new.html.twig', array('form' => $form));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment