Skip to content

Instantly share code, notes, and snippets.

@GaylordP
Last active February 20, 2018 15:41
Show Gist options
  • Save GaylordP/ed8451d14ecc255eb2c3cb412ffa7dfb to your computer and use it in GitHub Desktop.
Save GaylordP/ed8451d14ecc255eb2c3cb412ffa7dfb to your computer and use it in GitHub Desktop.
<?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