symfony - symfony2 form error -


the form's view data expected of type scalar, array or instance of \arrayaccess,  instance of class ecs\crmbundle\entity\customer.  

is error in browser..

form code:

<?php  namespace ecs\crmbundle\form;  use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface;  class customerdefaultconfigtype extends abstracttype {     public function buildform(formbuilderinterface $builder, array $options)     {         $builder             ->add('name')             ->add('customerstatus')             ->add('tags', null, array('multiple' => true, 'property' => 'tag_name'))         ;     }      public function getname()     {         return 'ecs_crmbundle_customerdefaultconfigtype';     } } 

and controller action:

<?php  namespace ecs\crmbundle\controller;  use ecs\crmbundle\entity\customerdefaultconfig; use ecs\crmbundle\form\customerdefaultconfigtype;     public function newaction()         {             $entity = new customerdefaultconfig();             $form   = $this->createform(new customerdefaultconfigtype(), $entity);              return $this->render('ecscrmbundle:customerdefaultconfig:new.html.twig', array(                 'entity' => $entity,                 'form'   => $form->createview()             ));         } 

this using symfony2.1 composer... ideas on how working?

since last form refactoring, have specified data_class in setdefaultoptions method in type.

see here (search data_class).

edit: correct link


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -