You are here

public static function MailchimpCampaignForm::templateCallback in Mailchimp 2.x

Same name and namespace in other branches
  1. 8 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 525

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;
}