You are here

public function AddUserToChannelForm::buildForm in Node.js integration 8

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

src/Form/AddUserToChannelForm.php, line 23

Class

AddUserToChannelForm

Namespace

Drupal\nodejs\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = array();
  $form['nodejs_uid'] = array(
    '#type' => 'textfield',
    '#description' => $this
      ->t('The user uid to add to a channel.'),
    '#title' => $this
      ->t('User uid to add'),
  );
  $form['nodejs_channel'] = array(
    '#type' => 'textfield',
    '#description' => $this
      ->t('The name of the channel to give a user access to.'),
    '#title' => $this
      ->t('Channel to add'),
  );
  $form['nodejs_submit'] = array(
    '#type' => 'submit',
    '#value' => $this
      ->t('Add user'),
  );
  return $form;
}