Added the possibility to add additional CSS to label.

This commit is contained in:
Jan Böhmer 2020-05-04 22:19:06 +02:00
parent 8b372a3443
commit fde1d7be4f
6 changed files with 116 additions and 23 deletions

View file

@ -195,6 +195,46 @@ class LabelOptions
return $this;
}
/**
* Gets additional CSS (it will simply be attached
* @return string
*/
public function getAdditionalCss(): string
{
return $this->additional_css;
}
/**
*
* @param string $additional_css
* @return LabelOptions
*/
public function setAdditionalCss(string $additional_css): LabelOptions
{
$this->additional_css = $additional_css;
return $this;
}
/**
* @return string
*/
public function getLinesMode(): string
{
return $this->lines_mode;
}
/**
* @param string $lines_mode
* @return LabelOptions
*/
public function setLinesMode(string $lines_mode): LabelOptions
{
$this->lines_mode = $lines_mode;
return $this;
}
}

View file

@ -26,6 +26,7 @@ use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@ -95,6 +96,15 @@ class LabelOptionsType extends AbstractType
],
'config_name' => 'label_config',
]);
$builder->add('additional_css', TextareaType::class, [
'label' => 'label_options.additional_css.label',
'empty_data' => '',
'attr' => [
'rows' => 4,
],
'required' => false,
]);
}
public function configureOptions(OptionsResolver $resolver)