public function SalvattoreAdminSettingsForm::buildForm in Salvattore (CSS driven Masonry) 8
Same name in this branch
- 8 src/SalvattoreAdminSettingsForm.php \Drupal\salvattore\SalvattoreAdminSettingsForm::buildForm()
- 8 src/Form/SalvattoreAdminSettingsForm.php \Drupal\salvattore\Form\SalvattoreAdminSettingsForm::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/ SalvattoreAdminSettingsForm.php, line 48 - Contains \Drupal\salvattore\Form\SalvattoreAdminSettingsForm.
Class
Namespace
Drupal\salvattore\FormCode
public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
$form = [];
$form['salvattore_use_min_js'] = [
'#title' => t('Javascript file to use'),
'#description' => t('Please choose whether you want the minified or the full version of the JS file.'),
'#type' => 'radios',
'#options' => [
'1' => 'Minified',
'0' => 'Full (debug)',
],
'#default_value' => \Drupal::config('salvattore.settings')
->get('salvattore_use_min_js'),
];
$form['salvattore_load_default_css'] = [
'#title' => t('Load default CSS'),
'#description' => t('Salvattore is easily configurable via CSS and you should write your own in your theme.<br>If some reason you want to use the default then enable this setting.'),
'#type' => 'checkbox',
'#default_value' => \Drupal::config('salvattore.settings')
->get('salvattore_load_default_css'),
];
return parent::buildForm($form, $form_state);
}