public function TemplatesForm::buildForm in Easychart 8.3
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/ TemplatesForm.php, line 35 - Contains \Drupal\easychart\Form\TemplatesForm
Class
Namespace
Drupal\easychart\FormCode
public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL) {
$config = $this
->config('easychart.settings');
$form['#attached']['library'][] = 'easychart/easychart.admin';
$form['#attached']['library'][] = 'easychart/lib.easycharts.full';
$form['#attached']['library'][] = 'easychart/lib.highcharts';
$form['templates'] = [
'#type' => 'textarea',
'#title' => $this
->t('Templates'),
'#title_display' => 'invisible',
'#default_value' => $config
->get('templates'),
'#description' => $this
->t("These templates will be selectable in the Easychart interface when creating/editing a chart."),
'#attributes' => array(
'class' => array(
'easychart-templates',
),
),
'#rows' => 30,
];
$form['actions']['reset'] = [
'#type' => 'submit',
'#value' => $this
->t('Reset to defaults'),
'#submit' => array(
'::resetForm',
),
'#limit_validation_errors' => array(),
'#weight' => 100,
];
return parent::buildForm($form, $form_state);
}