Browse Source

Update docs/dev_guide/custom_field/ajax_custom_formatter.rst

Co-Authored-By: bradfordcondon <bradford.condon@gmail.com>
Lacey-Anne Sanderson 6 years ago
parent
commit
f14f866d9d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      docs/dev_guide/custom_field/ajax_custom_formatter.rst

+ 1 - 1
docs/dev_guide/custom_field/ajax_custom_formatter.rst

@@ -8,7 +8,7 @@ Drupal and AJAX
 ---------------
 
 Drupal has its special way of doing AJAX!  You should `read the documentation carefully! <https://api.drupal.org/api/drupal/includes%21ajax.inc/group/ajax/7.x>`_ To Drupal, AJAX only makes sense as on forms, and field formatters **are not forms**.  Instead, they are `renderable arrays <https://www.drupal.org/docs/7/api/render-arrays/render-arrays-overview>`_
-This may seem obvious in hindsight: rather than accepting ``$form`` and ``&$form_state``, they accept ``&$element``, ``$entity_type``, ``$entity``, ``$langcode``, ``$items``, and ```$display``, where ``$element`` is the renderable array.
+As such, rather than accepting ``$form`` and ``&$form_state``, they accept ``&$element``, ``$entity_type``, ``$entity``, ``$langcode``, ``$items``, and ```$display``, where ``$element`` is the renderable array.
 
 This means if you want to add an AJAX callback to a field formatter, you  need a **seperate form file** that gets added in using ``drupal_get_form()``.  If you do this, you can build the AJAX as Drupal expects it.