Issue #2903322 by gaurav.kapoor, levmyshkin: Change FAPI Container example class to an array

8.7.x
Alex Pott 2019-02-22 08:23:51 +00:00
parent a047556569
commit dcf633a96c
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
1 changed files with 14 additions and 14 deletions

View File

@ -18,27 +18,27 @@ use Drupal\Core\Render\Element;
* *
* Usage example: * Usage example:
* @code * @code
* $form['needs_accommodation'] = array( * $form['needs_accommodation'] = [
* '#type' => 'checkbox', * '#type' => 'checkbox',
* '#title' => $this->t('Need Special Accommodations?'), * '#title' => $this->t('Need Special Accommodations?'),
* ); * ];
* *
* $form['accommodation'] = array( * $form['accommodation'] = [
* '#type' => 'container', * '#type' => 'container',
* '#attributes' => array( * '#attributes' => [
* 'class' => 'accommodation', * 'class' => ['accommodation'],
* ), * ],
* '#states' => array( * '#states' => [
* 'invisible' => array( * 'invisible' => [
* 'input[name="needs_accommodation"]' => array('checked' => FALSE), * 'input[name="needs_accommodation"]' => ['checked' => FALSE],
* ), * ],
* ), * ],
* ); * ];
* *
* $form['accommodation']['diet'] = array( * $form['accommodation']['diet'] = [
* '#type' => 'textfield', * '#type' => 'textfield',
* '#title' => $this->t('Dietary Restrictions'), * '#title' => $this->t('Dietary Restrictions'),
* ); * ];
* @endcode * @endcode
* *
* @RenderElement("container") * @RenderElement("container")