You are here

public static function MailchimpCampaignForm::templateCallback in Mailchimp 8

Same name and namespace in other branches
  1. 2.x modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php \Drupal\mailchimp_campaign\Form\MailchimpCampaignForm::templateCallback()

Ajax callback to render content with a template is selected.

Parameters

array $form: Form API array structure.

\Drupal\Core\Form\FormStateInterface $form_state: Form state information.

Return value

\Drupal\Core\Ajax\AjaxResponse Ajax response with the rendered content element.

File

modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php, line 463

Class

MailchimpCampaignForm
Form controller for the MailchimpCampaign entity edit form.

Namespace

Drupal\mailchimp_campaign\Form

Code

public static function templateCallback(array $form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $response
    ->addCommand(new ReplaceCommand('#content-sections', $form['content']));
  return $response;
}