aamant / configurable-attributes-bundle
Configurable attributes for Symfony
1.0.0
2017-03-22 07:43 UTC
Requires
- php: >=5.6.0
- symfony/form: ^2.8 || ^3.0
- symfony/framework-bundle: ^2.8 || ^3.0
- symfony/security-bundle: ^2.8 || ^3.0
- symfony/templating: ^2.8 || ^3.0
- symfony/twig-bundle: ^2.8 || ^3.0
- twig/twig: ^1.28 || ^2.0
This package is not auto-updated.
Last update: 2024-11-10 02:31:39 UTC
README
Install
Install with composer
composer require aamant/configurable-attributes-bundle
Modify AppKernel.php
$bundles = [
...
new Aamant\ConfigurableAttributesBundle\AamantConfigurableAttributesBundle(),
...
];
Add routes
configurable_attributes.attributes:
resource: "@AamantConfigurableAttributesBundle/Resources/config/routing.xml"
Use
Add relation to entity
/**
* @ORM\ManyToOne(targetEntity="\Aamant\ConfigurableAttributesBundle\Entity\Option")
* @ORM\JoinColumn(name="relation_id", referencedColumnName="id", onDelete="SET NULL", nullable=true)
*/
private $relation;
Form field
$builder
...
->add('relation', \Aamant\ConfigurableAttributesBundle\Form\AttributeOptionType::class, [
'definition' => 'test',
'placeholder' => '',
'required' => false,
])
...
;