You are here

public function GroupRequestMembershipRequestForm::buildForm in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/modules/social_group_request/src/Form/GroupRequestMembershipRequestForm.php \Drupal\social_group_request\Form\GroupRequestMembershipRequestForm::buildForm()
  2. 10.0.x modules/social_features/social_group/modules/social_group_request/src/Form/GroupRequestMembershipRequestForm.php \Drupal\social_group_request\Form\GroupRequestMembershipRequestForm::buildForm()
  3. 10.1.x modules/social_features/social_group/modules/social_group_request/src/Form/GroupRequestMembershipRequestForm.php \Drupal\social_group_request\Form\GroupRequestMembershipRequestForm::buildForm()
  4. 10.2.x modules/social_features/social_group/modules/social_group_request/src/Form/GroupRequestMembershipRequestForm.php \Drupal\social_group_request\Form\GroupRequestMembershipRequestForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

modules/social_features/social_group/modules/social_group_request/src/Form/GroupRequestMembershipRequestForm.php, line 101

Class

GroupRequestMembershipRequestForm
Provides a form to request group membership.

Namespace

Drupal\social_group_request\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, GroupInterface $group = NULL) {
  $this->group = $group;
  $form['description'] = [
    '#type' => 'html_tag',
    '#tag' => 'p',
    '#value' => $this
      ->t('You can leave a message in your request. Only when your request is approved, you will receive a notification via email and notification center.'),
  ];
  $form['message'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Message'),
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Send request'),
    '#button_type' => 'primary',
  ];
  return $form;
}