You are here

public static function EntityFormProxy::ajax in Lightning Media 8.2

Same name and namespace in other branches
  1. 8.4 src/Plugin/EntityBrowser/Widget/EntityFormProxy.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\EntityFormProxy::ajax()
  2. 8 src/Plugin/EntityBrowser/Widget/EntityFormProxy.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\EntityFormProxy::ajax()
  3. 8.3 src/Plugin/EntityBrowser/Widget/EntityFormProxy.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\EntityFormProxy::ajax()

AJAX callback. Returns the rebuilt inline entity form.

Parameters

array $form: The complete form.

FormStateInterface $form_state: The current form state.

Return value

\Drupal\Core\Ajax\AjaxResponse The AJAX response.

1 call to EntityFormProxy::ajax()
FileUpload::ajax in src/Plugin/EntityBrowser/Widget/FileUpload.php
AJAX callback. Returns the rebuilt inline entity form.
1 method overrides EntityFormProxy::ajax()
FileUpload::ajax in src/Plugin/EntityBrowser/Widget/FileUpload.php
AJAX callback. Returns the rebuilt inline entity form.

File

src/Plugin/EntityBrowser/Widget/EntityFormProxy.php, line 235

Class

EntityFormProxy
Base class for EB widgets which wrap around an (inline) entity form.

Namespace

Drupal\lightning_media\Plugin\EntityBrowser\Widget

Code

public static function ajax(array &$form, FormStateInterface $form_state) {
  return (new AjaxResponse())
    ->addCommand(new ReplaceCommand('#entity', $form['widget']['entity']))
    ->addCommand(new ReplaceCommand('#bundle', $form['widget']['bundle']));
}