public function MailingListController::subscribeForm in Mailing List 8
Returns a subscription form.
Parameters
\Drupal\mailing_list\MailingListInterface $mailing_list: The subscription's mailing list.
Return value
array The subscription add form.
1 string reference to 'MailingListController::subscribeForm'
File
- src/
Controller/ MailingListController.php, line 96
Class
- MailingListController
- Returns responses for Mailing list routes.
Namespace
Drupal\mailing_list\ControllerCode
public function subscribeForm(MailingListInterface $mailing_list) {
$subscription = $this
->entityTypeManager()
->getStorage('mailing_list_subscription')
->create([
'mailing_list' => $mailing_list
->id(),
]);
return $this
->entityFormBuilder()
->getForm($subscription);
}