for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* (c) Tomasz Kunicki <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace AppBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
* Class UnitType
* @package AppBundle\Form\Type
class UnitType extends AbstractType
{
* @param FormBuilderInterface $builder
* @param array $options
public function buildForm(FormBuilderInterface $builder, array $options)
$builder
->add(
'name',
'text',
array(
'constraints' => [
new Length(array('min' => 1, 'max' => 64)),
new NotBlank(),
]
)
'shortcut',
new Length(array('min' => 1, 'max' => 3)),
);
}
* @param OptionsResolver $resolver
public function configureOptions(OptionsResolver $resolver)