You are here

public function FormHelper::initForm in Filebrowser 3.x

Same name and namespace in other branches
  1. 8.2 src/Services/FormHelper.php \Drupal\filebrowser\Services\FormHelper::initForm()

File

src/Services/FormHelper.php, line 22

Class

FormHelper
Class FormHelper Service that provides utilities to forms

Namespace

Drupal\filebrowser\Services

Code

public function initForm(&$form, NodeInterface $node) {
  $this->node = $node;
  $form['nid'] = [
    '#type' => 'value',
    '#value' => $this->node
      ->id(),
  ];
  $form['fids'] = [
    '#type' => 'value',
    '#value' => null,
  ];
  $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
  $form['#attached']['library'][] = 'filebrowser/filebrowser-styles';
  $form['#attached']['library'][] = 'core/jquery.form';
}