Fieldset.php

Same filename and directory in other branches
  1. 9 core/lib/Drupal/Core/Render/Element/Fieldset.php
  2. 8.9.x core/lib/Drupal/Core/Render/Element/Fieldset.php
  3. 10 core/lib/Drupal/Core/Render/Element/Fieldset.php

Namespace

Drupal\Core\Render\Element

File

core/lib/Drupal/Core/Render/Element/Fieldset.php

View source
<?php

namespace Drupal\Core\Render\Element;

use Drupal\Core\Render\Attribute\RenderElement;

/**
 * Provides a render element for a group of form elements.
 *
 * Usage example:
 * @code
 * $form['author'] = [
 *   '#type' => 'fieldset',
 *   '#title' => $this->t('Author'),
 * ];
 *
 * $form['author']['name'] = [
 *   '#type' => 'textfield',
 *   '#title' => $this->t('Name'),
 * ];
 * @endcode
 *
 * @see \Drupal\Core\Render\Element\Fieldgroup
 * @see \Drupal\Core\Render\Element\Details
 */
class Fieldset extends RenderElementBase {
    
    /**
     * {@inheritdoc}
     */
    public function getInfo() {
        $class = static::class;
        return [
            '#process' => [
                [
                    $class,
                    'processGroup',
                ],
                [
                    $class,
                    'processAjaxForm',
                ],
            ],
            '#pre_render' => [
                [
                    $class,
                    'preRenderGroup',
                ],
            ],
            '#value' => NULL,
            '#theme_wrappers' => [
                'fieldset',
            ],
        ];
    }

}

Classes

Title Deprecated Summary
Fieldset Provides a render element for a group of form elements.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.