|
@@ -41,7 +41,12 @@ class ModelAutocompleteType extends AbstractType
|
|
|
$builder->setAttribute('minimum_input_length', $options['minimum_input_length']);
|
|
|
$builder->setAttribute('items_per_page', $options['items_per_page']);
|
|
|
$builder->setAttribute('req_param_name_page_number', $options['req_param_name_page_number']);
|
|
|
- $builder->setAttribute('disabled', $options['disabled'] || $options['read_only']);
|
|
|
+ $builder->setAttribute(
|
|
|
+ 'disabled',
|
|
|
+ $options['disabled']
|
|
|
+ // NEXT_MAJOR: Remove this when bumping Symfony constraint to 2.8+
|
|
|
+ || (array_key_exists('read_only', $options) && $options['read_only'])
|
|
|
+ );
|
|
|
$builder->setAttribute('to_string_callback', $options['to_string_callback']);
|
|
|
|
|
|
if ($options['multiple']) {
|
|
@@ -65,7 +70,6 @@ class ModelAutocompleteType extends AbstractType
|
|
|
$view->vars['minimum_input_length'] = $options['minimum_input_length'];
|
|
|
$view->vars['items_per_page'] = $options['items_per_page'];
|
|
|
$view->vars['width'] = $options['width'];
|
|
|
- $view->vars['read_only'] = $options['read_only'];
|
|
|
|
|
|
// ajax parameters
|
|
|
$view->vars['url'] = $options['url'];
|
|
@@ -119,7 +123,6 @@ class ModelAutocompleteType extends AbstractType
|
|
|
'multiple' => false,
|
|
|
'width' => '',
|
|
|
'context' => '',
|
|
|
- 'read_only' => false,
|
|
|
|
|
|
'placeholder' => '',
|
|
|
'minimum_input_length' => 3, //minimum 3 chars should be typed to load ajax data
|