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:
* @code
* $form['needs_accommodation'] = array(
* $form['needs_accommodation'] = [
* '#type' => 'checkbox',
* '#title' => $this->t('Need Special Accommodations?'),
* );
* ];
*
* $form['accommodation'] = array(
* $form['accommodation'] = [
* '#type' => 'container',
* '#attributes' => array(
* 'class' => 'accommodation',
* ),
* '#states' => array(
* 'invisible' => array(
* 'input[name="needs_accommodation"]' => array('checked' => FALSE),
* ),
* ),
* );
* '#attributes' => [
* 'class' => ['accommodation'],
* ],
* '#states' => [
* 'invisible' => [
* 'input[name="needs_accommodation"]' => ['checked' => FALSE],
* ],
* ],
* ];
*
* $form['accommodation']['diet'] = array(
* $form['accommodation']['diet'] = [
* '#type' => 'textfield',
* '#title' => $this->t('Dietary Restrictions'),
* );
* ];
* @endcode
*
* @RenderElement("container")