public function SubscriptionsBlockForm::form in Simplenews 8
Same name and namespace in other branches
- 8.2 src/Form/SubscriptionsBlockForm.php \Drupal\simplenews\Form\SubscriptionsBlockForm::form()
- 3.x src/Form/SubscriptionsBlockForm.php \Drupal\simplenews\Form\SubscriptionsBlockForm::form()
Gets the actual form array to be built.
Overrides SubscriptionsFormBase::form
See also
\Drupal\Core\Entity\EntityForm::processForm()
\Drupal\Core\Entity\EntityForm::afterBuild()
File
- src/
Form/ SubscriptionsBlockForm.php, line 41
Class
- SubscriptionsBlockForm
- Configure simplenews subscriptions of the logged user.
Namespace
Drupal\simplenews\FormCode
public function form(array $form, FormStateInterface $form_state) {
// Hide subscription widget if only one newsletter available.
if (count($this
->getNewsletters()) == 1) {
$this
->getSubscriptionWidget($form_state)
->setHidden();
}
$form = parent::form($form, $form_state);
$form['message'] = array(
'#type' => 'item',
'#markup' => $this->message,
);
return $form;
}