Paragraphs Editor
DeliveryProviderInterface.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 /**
9  * Represents a paragraphs editor form delivery plugin.
10  *
11  * Delivery Provider plugins are used to change the ajax behavior of the
12  * paragraphs editor editing experience. The default plugin delivers all forms
13  * to the user as a modal dialog. This is built on core functionality and is
14  * consistent with the way core handles other Editor dialogs, but it's not the
15  * only way to display a form.
16  *
17  * By implementing a delivery provider plugin you can expirement with different
18  * ajax behaviors for displaying forms to the user. This is built entirely on
19  * top of the Drupal Ajax API.
20  */
22 
23  /**
24  * Navigates the user to a form.
25  *
26  * @param \Drupal\Core\Ajax\AjaxResponse $response
27  * The response object to add commands to.
28  * @param string $title
29  * The form title.
30  * @param mixed $contents
31  * The contents to be delivered to the user. This could be rendered markup
32  * or a render array.
33  */
34  public function navigate(AjaxResponse $response, $title, $contents);
35 
36  /**
37  * Delivers widget binder data to the client.
38  *
39  * @param \Drupal\Core\Ajax\AjaxResponse $response
40  * The response object to add commands to.
41  * @param \Drupal\paragraphs_editor\WidgetBinder\WidgetBinderData $data
42  * The data to be delivered.
43  */
44  public function sendData(AjaxResponse $response, WidgetBinderData $data);
45 
46  /**
47  * Closes a form for the user.
48  *
49  * @param \Drupal\Core\Ajax\AjaxResponse $response
50  * The response object to add commands to.
51  */
52  public function close(AjaxResponse $response);
53 
54 }
sendData(AjaxResponse $response, WidgetBinderData $data)