for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Maikuro\DistributedConfigurationBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* Class KeyValueType.
*/
class KeyValueType extends AbstractType
{
* @param FormBuilderInterface $builder
* @param array $options
public function buildForm(FormBuilderInterface $builder, array $options)
$builder
->add('key')
->add('value')
;
}
* {@inheritdoc}
* BC for SF < 2.7
public function setDefaultOptions(OptionsResolverInterface $resolver)
$this->configureOptions($resolver);
public function configureOptions(OptionsResolver $resolver)
$resolver->setDefaults([
'data_class' => 'Maikuro\DistributedConfigurationBundle\Model\KeyValue',
'csrf_protection' => false,
]);
* BC for SF < 3.0
public function getName()
return $this->getBlockPrefix();
public function getBlockPrefix()
return 'key_value';