add a required field to custom fields type

ref Chill-project/Chill-CustomFields#17
This commit is contained in:
2015-12-10 17:16:59 +01:00
parent b88bb50b56
commit 3230659a4b
11 changed files with 136 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ use Chill\CustomFieldsBundle\Service\CustomFieldProvider;
use Chill\CustomFieldsBundle\Form\DataTransformer\CustomFieldDataTransformer;
use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\CustomFieldsBundle\CustomFields\CustomFieldTitle;
class CustomFieldType extends AbstractType
{
@@ -50,6 +51,7 @@ class CustomFieldType extends AbstractType
$this->customFieldCompiler
->getCustomFieldByType($cf->getType())
->buildForm($builder, $cf);
$builder->get($cf->getSlug())->setRequired($cf->isRequired());
}
}