public function ParagraphBlocksSettingsForm::buildForm in Paragraph blocks 8.2
Same name and namespace in other branches
- 3.x src/Form/ParagraphBlocksSettingsForm.php \Drupal\paragraph_blocks\Form\ParagraphBlocksSettingsForm::buildForm()
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides ConfigFormBase::buildForm
File
- src/
Form/ ParagraphBlocksSettingsForm.php, line 30
Class
- ParagraphBlocksSettingsForm
- Form for Paragraph Blocks settings.
Namespace
Drupal\paragraph_blocks\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('paragraph_blocks.settings');
$form['max_cardinality'] = [
'#type' => 'number',
'#title' => $this
->t('Max cardinality of paragraphs you want to see in Layout Builder.'),
'#default_value' => $config
->get('max_cardinality'),
'#description' => $this
->t('Layout Builder allows you to place each item in a multi-value paragraphs field as its own block. This sets the max number you think you need to see. You can change it later.'),
];
return parent::buildForm($form, $form_state);
}