src/PN/Bundle/ProductBundle/Form/CollectionType.php
/**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
@param FormBuilderInterface $builder
@param array $options
@param FormBuilderInterface $builder @param array $options
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $postTypeModel = new PostTypeModel();
        $postTypeModel->add("description", "Description", ["required" => false]);
        $builder
            ->add('title')
            ->add('seo', SeoType::class)
            ->add('post', PostType::class, [
                "attributes" => $postTypeModel,
            ])
            ->add('tarteb', IntegerType::class, [
                "required" => false,
                "label" => "Sort No.",
                'attr' => ['min' => 0],
            ])
            ->add('publish', CheckboxType::class, [
                "required" => false,
                "label" => "Active",
            ])
            ->add('translations', TranslationsType::class, [
                'entry_type' => CollectionTranslationType::class,
                "label" => false,
                'entry_language_options' => [
                    'en' => [
                        'required' => true,
                    ],
                ],
            ]);
    }
public function buildForm ( FormBuilderInterface $ builder , array $ options ) { $ postTypeModel = new PostTypeModel ( ) ; $ postTypeModel -> add ( " description " , " Description " , [ " required " => false ] ) ; $ builder -> add ( 'title' ) -> add ( 'seo' , SeoType :: class ) -> add ( 'post' , PostType :: class , [ " attributes " => $ postTypeModel , ] ) -> add ( 'tarteb' , IntegerType :: class , [ " required " => false , " label " => " Sort No. " , 'attr' => [ 'min' => 0 ] , ] ) -> add ( 'publish' , CheckboxType :: class , [ " required " => false , " label " => " Active " , ] ) -> add ( 'translations' , TranslationsType :: class , [ 'entry_type' => CollectionTranslationType :: class , " label " => false , 'entry_language_options' => [ 'en' => [ 'required' => true , ] , ] , ] ) ; }
@param FormBuilderInterface $builder
 @param array $options
@param FormBuilderInterface $builder @param array $options
//            ->add('image', SingleImageType::class, ["mapped" => false])