CssInjectorForm.php in Asset Injector 8
File
src/Form/CssInjectorForm.php
View source
<?php
namespace Drupal\asset_injector\Form;
use Drupal\Core\Form\FormStateInterface;
class CssInjectorForm extends AssetInjectorFormBase {
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$entity = $this->entity;
$form['advanced']['media'] = [
'#type' => 'select',
'#title' => 'Media',
'#description' => $this
->t('Which media types is the CSS used.'),
'#options' => [
'all' => $this
->t('All'),
'print' => $this
->t('Print'),
'screen' => $this
->t('Screen'),
],
'#default_value' => $entity->media,
];
$form['advanced']['preprocess'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Preprocess CSS'),
'#description' => $this
->t('If the CSS is preprocessed, and CSS aggregation is enabled, the script file will be aggregated.'),
'#default_value' => $entity->preprocess,
];
$form['code']['#attributes']['data-ace-mode'] = 'css';
return $form;
}
}