You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Autocomplete/doc/index.rst
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -290,13 +290,13 @@ Passing Extra Options to the Ajax-powered Autocomplete
290
290
Autocomplete field options are not preserved when the field is rendered on an Ajax call. So, features like exclude some options
291
291
based on the current form data are not possible by default. To partially avoid this limitation, the `extra_options` option was added.
292
292
293
-
::warning
293
+
.. warning::
294
294
295
-
Only scalar values (`string`, `integer`, `float`, `boolean`), `null` and `arrays` (consisted from the same types as mentioned before) can be passed as extra options.
295
+
Only scalar values (``string``, ``integer``, ``float``, ``boolean``), ``null`` and ``array`` (consisted from the same types as mentioned before) can be passed as extra options.
296
296
297
-
Considering the following example, when the form type is rendered for the first time, it will use the `query_builder` defined
298
-
while adding a `food` field to the `FoodForm`. However, when the Ajax is used to fetch the results, on the consequent renders,
299
-
the default `query_builder` will be used::
297
+
Considering the following example, when the form type is rendered for the first time, it will use the ``query_builder`` defined
298
+
while adding a ``food`` field to the ``FoodForm``. However, when the Ajax is used to fetch the results, on the consequent renders,
299
+
the default ``query_builder`` will be used::
300
300
301
301
// src/Form/FoodForm.php
302
302
// ...
@@ -323,8 +323,8 @@ the default `query_builder` will be used::
323
323
}
324
324
325
325
If some food can be consisted of other foods, we might want to exclude the "root" food from the list of available foods.
326
-
To achieve this, we can remove the `query_builder` option from the above example and pass the `excluded_foods` extra option
327
-
to the `FoodAutocompleteField`::
326
+
To achieve this, we can remove the ``query_builder`` option from the above example and pass the ``excluded_foods`` extra option
327
+
to the ``FoodAutocompleteField``::
328
328
329
329
// src/Form/FoodForm.php
330
330
// ...
@@ -345,8 +345,8 @@ to the `FoodAutocompleteField`::
345
345
}
346
346
}
347
347
348
-
The magic of the `extra_options` is that it will be passed to the `FoodAutocompleteField` every time an Ajax call is made.
349
-
So now, we can just use the `excluded_foods` extra option in the default `query_builder` of the `FoodAutocompleteField`::
348
+
The magic of the ``extra_options`` is that it will be passed to the ``FoodAutocompleteField`` every time an Ajax call is made.
349
+
So now, we can just use the ``excluded_foods`` extra option in the default ``query_builder`` of the ``FoodAutocompleteField``::
350
350
351
351
// src/Form/FoodAutocompleteField.php
352
352
// ...
@@ -602,7 +602,7 @@ If you need to pass extra options to the autocompleter, you can do so by impleme
602
602
603
603
.. tip::
604
604
605
-
If you want to know **why** you might need to use the `extra options` feature, see :ref:`passing-extra-options-to-the-ajax-powered-autocomplete`.
605
+
If you want to know **why** you might need to use the ``extra_options`` feature, see :ref:`passing-extra-options-to-the-ajax-powered-autocomplete`.
0 commit comments