aamant / configurable-attributes-bundle
Configurable attributes for Symfony
Installs: 52
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/aamant/configurable-attributes-bundle
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: 2025-10-26 07:09:38 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,
    ])
    ...
;