sample_library: css: # For some reason, you need to put css under 'theme'. theme: css/example.css: {} dependencies: # jQuery is not included by default, so we add it as a dependency -core/jquery # We are also going to use jQuery.once so that code doesn't trigger multiple times. -core/jquery.once # drupal and drupalSettings are not included by default either. -core/drupal
/** * Returns a unique string identifying the form. * * @return string * The unique string identifying the form. */ publicfunctiongetFormId() { return"test_form"; }
/** * Form constructor. * * @param array $form * An associative array containing the structure of the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * * @return array * The form structure. */ publicfunctionbuildForm(array$form, FormStateInterface $form_state) { $form['#attributes'] = array('class' => 'editForm editForm-thread');
/** * Form submission handler. * * @param array $form * An associative array containing the structure of the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ publicfunctionsubmitForm(array &$form, FormStateInterface $form_state) { // TODO: Implement submitForm() method. } }