php - how to hide an array type of entity in a form in symfony2 -


i have array type in entity want add form type hidden field. tried following doesnt work. kills browser.

any appreciated.

//entity     class test{           /**          * @orm\column(name="test_image_files", type="array",nullable=true)          */         private $testimages;            /**          * @return mixed          */         public function gettestimages()         {             return $this->testimages;         }          /**          * @param mixed $testimages          */         public function settestimages($testimages)         {             $this->testimages = $testimages;         }      } 

// formtype

class testtype extends abstracttype {     public function buildform(formbuilderinterface $builder, array $options)     {         $builder->add('testimages','hidden');     } } 

//twig

{{ form_widget(form.testimages) }} 

this handle current situation,

echo form_widget(form.testimages) inside <div style="display:none"></div>.

i hope helps.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -