Last active
May 23, 2020 14:02
-
-
Save mysiar/6212b19bf961ef07000164064e6041a8 to your computer and use it in GitHub Desktop.
Color picker for EasyAdmin - simple https://mysiar.github.io/dev/2020/05/23/color-picker4easyadmin.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\Extension\Core\Type\TextType; | |
use Symfony\Component\OptionsResolver\OptionsResolver; | |
class ColorPickerType extends AbstractType | |
{ | |
public function getParent(): string | |
{ | |
return TextType::class; | |
} | |
public function configureOptions(OptionsResolver $resolver): void | |
{ | |
$resolver->setDefaults([ | |
'attr' => [ | |
'class' => 'form-control colorpicker', | |
], | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment