Open manuel-adan opened 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'), ], ], ], ];
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: