1
프런트 엔드에서 사용자가 링크를 클릭했을 때 팝업창에 내 사용자 정의 양식을 표시하고 싶습니다. 웹에서 보여주는 많은 해결책을 시도했지만 저를 위해 작동하지 않습니다.Drupal 8 팝업창이있는 사용자 정의 양식
여기 내 코드입니다.
$response = new AjaxResponse();
// Get the modal form using the form builder.
$modal_form = $this->formBuilder->getForm('Drupal\fwsactions\Forms\FwsActionsForm');
$modal_form['#attached']['library'][] = 'core/drupal.dialog.ajax';
// Add an AJAX command to open a modal dialog with the form as the content.
$modal_form = render($modal_form);
$response->addCommand(new OpenModalDialogCommand('My Modal Form', $modal_form, ['width' => '800']));
return $response;
링크 만 누르면이 양식을 열려면 어떻게해야합니까?