Last active
February 20, 2018 15:41
-
-
Save GaylordP/ed8451d14ecc255eb2c3cb412ffa7dfb to your computer and use it in GitHub Desktop.
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 | |
namespace GaylordP\FormFontAwesomeBundle\Form; | |
use Symfony\Component\Form\AbstractTypeExtension; | |
use Symfony\Component\Form\Extension\Core\Type\FormType; | |
use Symfony\Component\Form\FormInterface; | |
use Symfony\Component\Form\FormView; | |
use Symfony\Component\OptionsResolver\OptionsResolver; | |
class FormTypeExtension extends AbstractTypeExtension | |
{ | |
public function getExtendedType(): string | |
{ | |
return FormType::class; | |
} | |
public function configureOptions(OptionsResolver $resolver): void | |
{ | |
dump('A'); | |
$resolver->setDefined([ | |
'ico', | |
]); | |
} | |
public function buildView(FormView $view, FormInterface $form, array $options): void | |
{ | |
dump('B'); | |
$view->vars['ico'] = $options['ico']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment