for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Lug package.
*
* (c) Eric GELOEN <[email protected]>
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/
namespace Lug\Bundle\UiBundle\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author GeLo <[email protected]>
abstract class AbstractIconExtension extends AbstractTypeExtension
{
* {@inheritdoc}
public function buildView(FormView $view, FormInterface $form, array $options)
$view->vars['icon'] = $options['icon'];
}
public function configureOptions(OptionsResolver $resolver)
$resolver
->setDefault('icon', null)
->setAllowedTypes('icon', ['string', 'null']);