2012-07-07 09:13:13 +00:00
|
|
|
<?php
|
|
|
|
namespace KekRozsak\FrontBundle\Form\Extension;
|
|
|
|
|
|
|
|
use Symfony\Component\Form\AbstractTypeExtension;
|
|
|
|
use Symfony\Component\Form\FormInterface;
|
2012-07-23 13:46:14 +00:00
|
|
|
use Symfony\Component\Form\FormView;
|
2012-07-07 09:13:13 +00:00
|
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
|
|
|
|
|
|
class HelpMessageTypeExtension extends AbstractTypeExtension
|
|
|
|
{
|
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
|
|
{
|
|
|
|
$builder->setAttribute('help', $options['help']);
|
|
|
|
}
|
|
|
|
|
2012-07-23 13:46:14 +00:00
|
|
|
public function buildView(FormView $view, FormInterface $form, array $options)
|
2012-07-07 09:13:13 +00:00
|
|
|
{
|
2012-07-23 13:46:14 +00:00
|
|
|
$view->set('help', $form->getAttribute('help'));
|
2012-07-07 09:13:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getDefaultOptions()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'help' => null,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getExtendedType()
|
|
|
|
{
|
|
|
|
return 'field';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|