Symfony 2.8 Introduces the Range Form Element

Screen Shot 2015-11-27 at 11.53.37 AM The range form element is now available in Symfony 2.8.

The range element is part of the HTML5 specification. In modern browsers, the range element is rendered as a slider.

You can use it like this.

$builder->add('volume', 'Symfony\Component\Form\Extension\Core\Type\RangeType', [
    'attr' => ['min' => 0, 'max' => 11]

These go to eleven.

Screen shot 2015-11-22 at 8.53.10 PM

Share Button