2017 © Pedro Peláez
 

library configurable-attributes-bundle

Configurable attributes for Symfony

image

aamant/configurable-attributes-bundle

Configurable attributes for Symfony

  • Wednesday, March 22, 2017
  • by aamant
  • Repository
  • 1 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

README

Install

Install with composer, (*1)

composer require aamant/configurable-attributes-bundle, (*2)

Modify AppKernel.php, (*3)

$bundles = [
    ...
    new Aamant\ConfigurableAttributesBundle\AamantConfigurableAttributesBundle(),
    ...
];

Add routes, (*4)

configurable_attributes.attributes:
    resource: "@AamantConfigurableAttributesBundle/Resources/config/routing.xml"

Use

Add relation to entity, (*5)

/**
 * @ORM\ManyToOne(targetEntity="\Aamant\ConfigurableAttributesBundle\Entity\Option")
 * @ORM\JoinColumn(name="relation_id", referencedColumnName="id", onDelete="SET NULL", nullable=true)
 */
private $relation;

Form field, (*6)

$builder
    ...
    ->add('relation', \Aamant\ConfigurableAttributesBundle\Form\AttributeOptionType::class, [
        'definition'    => 'test',
        'placeholder'   => '',
        'required'      => false,
    ])
    ...
;

The Versions