modules/acm_customer/src/Controller/CustomerController.php
public function formPage($action = NULL, $id = NULL) {
    $plugin = $this->customerPagesManager->createInstance($this->customerPagesPlugin, ['action' => $action, 'id' => $id]);
    $form_state = new FormState();
    $form = $this->formBuilder->buildForm($plugin, $form_state);
    $form['#attached']['library'][] = 'core/jquery.form';
    $form['#attached']['library'][] = 'core/drupal.ajax';
    $form['#attached']['library'][] = 'acm_customer/single_page_app';
    $form['#attached']['drupalSettings']['acm_customer'] = [
      'customerPagesPath' => Url::fromRoute('acm_customer.view_page')->toString(),
      'ajaxCustomerPagesPath' => Url::fromRoute('acm_customer.ajax_view_page')->toString(),
    ];
    return $form;
  }
public function formPage($action = NULL, $id = NULL) {
    $plugin = $this->customerPagesManager->createInstance($this->customerPagesPlugin, ['action' => $action, 'id' => $id]);
    $form_state = new FormState();
    $form = $this->formBuilder->buildForm($plugin, $form_state);
    $form['#attached']['library'][] = 'core/jquery.form';
    $form['#attached']['library'][] = 'core/drupal.ajax';
    $form['#attached']['library'][] = 'acm_customer/single_page_app';
    $form['#attached']['drupalSettings']['acm_customer'] = [
      'customerPagesPath' => Url::fromRoute('acm_customer.view_page')->toString(),
      'ajaxCustomerPagesPath' => Url::fromRoute('acm_customer.ajax_view_page')->toString(),
    ];
    return $form;
  }
public function formPage ( $ action = NULL , $ id = NULL ) { $ plugin = $ this -> customerPagesManager -> createInstance ( $ this -> customerPagesPlugin , [ 'action' => $ action , 'id' => $ id ] ) ; $ form_state = new FormState ( ) ; $ form = $ this -> formBuilder -> buildForm ( $ plugin , $ form_state ) ; $ form [ '#attached' ] [ 'library' ] [ ] = 'core/jquery.form' ; $ form [ '#attached' ] [ 'library' ] [ ] = 'core/drupal.ajax' ; $ form [ '#attached' ] [ 'library' ] [ ] = 'acm_customer/single_page_app' ; $ form [ '#attached' ] [ 'drupalSettings' ] [ 'acm_customer' ] = [ 'customerPagesPath' => Url :: fromRoute ( 'acm_customer.view_page' ) -> toString ( ) , 'ajaxCustomerPagesPath' => Url :: fromRoute ( 'acm_customer.ajax_view_page' ) -> toString ( ) , ] ; return $ form ; }
Renders a customer page.

@param string $action
The action route parameter.
@param string $id
The id route parameter.
Renders a customer page .