Skip to content

Instantly share code, notes, and snippets.

@pjedrzejewski
Created September 25, 2011 19:24
Show Gist options
  • Save pjedrzejewski/1241008 to your computer and use it in GitHub Desktop.
Save pjedrzejewski/1241008 to your computer and use it in GitHub Desktop.
Easy categorizing with Symfony2, gist #6.
<?php
namespace Application\Bundle\AssortmentBundle\Form\Type;
use Sylius\Bundle\AssortmentBundle\Form\Type\ProductFormType as BaseProductFormType;
use Symfony\Component\Form\FormBuilder;
class ProductFormType extends BaseProductFormType
{
public function buildForm(FormBuilder $builder, array $options)
{
parent::buildForm($builder, $options);
$builder
->add('category', 'sylius_catalog_category_choice', array(
'multiple' => false,
'catalog_alias' => 'assortment'
))
;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment