public function ForumForm::form in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/forum/src/Form/ForumForm.php \Drupal\forum\Form\ForumForm::form()
Gets the actual form array to be built.
Overrides TermForm::form
See also
\Drupal\Core\Entity\EntityForm::processForm()
\Drupal\Core\Entity\EntityForm::afterBuild()
1 call to ForumForm::form()
- ContainerForm::form in core/
modules/ forum/ src/ Form/ ContainerForm.php - Gets the actual form array to be built.
1 method overrides ForumForm::form()
- ContainerForm::form in core/
modules/ forum/ src/ Form/ ContainerForm.php - Gets the actual form array to be built.
File
- core/
modules/ forum/ src/ Form/ ForumForm.php, line 36 - Contains \Drupal\forum\Form\ForumForm.
Class
- ForumForm
- Base form for forum term edit forms.
Namespace
Drupal\forum\FormCode
public function form(array $form, FormStateInterface $form_state) {
$taxonomy_term = $this->entity;
// Build the bulk of the form from the parent taxonomy term form.
$form = parent::form($form, $form_state, $taxonomy_term);
// Set the title and description of the name field.
$form['name']['#title'] = $this
->t('Forum name');
$form['name']['#description'] = $this
->t('Short but meaningful name for this collection of threaded discussions.');
// Change the description.
$form['description']['#description'] = $this
->t('Description and guidelines for discussions within this forum.');
// Re-use the weight field.
$form['weight'] = $form['relations']['weight'];
// Remove the remaining relations fields.
unset($form['relations']);
// Our parent field is different to the taxonomy term.
$form['parent']['#tree'] = TRUE;
$form['parent'][0] = $this
->forumParentSelect($taxonomy_term
->id(), $this
->t('Parent'));
$form['#theme_wrappers'] = array(
'form__forum',
);
$this->forumFormType = $this
->t('forum');
return $form;
}