nuvoleweb / ui_patterns

[NOTE] Development has moved to https://drupal.org/project/ui_patterns
https://drupal.org/project/ui_patterns
GNU General Public License v2.0
85 stars 56 forks source link

275 form fields processing #276

Open manuel-adan opened 4 years ago

manuel-adan commented 4 years ago

Initial approach to make form fields be processed. This proposes an additional / alternate way to define pattern fields content in render arrays, by adding them as direct regular render children as follows:

    $form['content'] = [
      '#type' => 'pattern',
      '#id' => 'call_to_action',
      '#variant' => 'jumbotron',
      'title' => [
        '#markup' => $this->t('Explore our catalog'),
      ],
      'lead' => [
        'text' => [
          '#type' => 'textfield',
          '#required' => TRUE,
          '#placeholder' => $this->t('Product name, brand, reference...'),
        ],
      ],
      'action_link' => [
        'actions' => [
          '#type' => 'actions',
          'submit' => [
            '#type' => 'submit',
            '#value' => $this->t('Search'),
          ],
        ],
      ],
    ];