sonata admin - how to add ManyToOne property field in configureListfield in sonataAdmin -


I have a phone unit unit that contains many properties for many unit entity classes I

An exception is given during the rendering of a template ("You must define a associated_property <: when I want to add the idGrade area to FonctionnaireAdmin's ConfigureListField (using SonataAdmin) I encountered this error / code> option or Create a \ __counter __ \ Examens \ ExamensBundle \ unit \ Grade Proxy :: __ toString service examens.examens.admin.fonctionnaire from the field option idGrade to the method is in SonataDoctrineORMAdminBundle "): CRUD: Line_ on line_list_orm_many_to_one.html.tw

Fontionnaire.php class: < Pre> & lt ;? Php namespace exams \ ExamensBundle \ Entity; Use the theory / ORM \ mapping as an ORM; / ** * PhoneNationLayer * / Class Fictionalair {//...//// ** * @VARAEfimens \ Examinations Bundle \ Unit \ Grade * / Private $ IDGed; //...//}

FonctionnaireAdmin.php:

  & lt ;? Php namespace exams ExamensBundle \ Admin; Use Sonata \ AdminBundle \ Admin \ Admin; Sonata \ AdminBundle \ Datagrid \ ListMapper; Sonata \ AdminBundle \ Datagrid \ DatagridMapper; Sonata \ AdminBundle \ Validator \ errorElement; Sonata \ AdminBundle \ Form \ Use FormMapper; Sonata \ AdminBundle \ Show \ ShowMapper; Use Exam \ ExamensBundle \ Entity \ Fonctionnaire; Square FonctionnaireAdmin extension extension [protected $ datagridValues ​​= array ('_sort_order' => 'ASC', '_sort_by' = & gt; 'codefone') ;; Protected function configFormFields (FormMapper $ formMapper) {$ formMapper - & gt; Adding ('Nomar', 'Text', array ('label' = & gt; 'Nom arabe')) - & gt; Adding ('prenomAr', 'text', array ('label' = & gt; 'prime enterprise')) - & gt; Add ('NamFrame', 'Text', Arrays ('Labels' = & gt; 'Noam Franssey')) - & gt; Add ('Prenomfr', 'text', array ('label' = & gt; 'Pra Francesa')) - & gt; Add ('nomUtilisateur', 'text', array ('label' = & gt; 'nom et (' atepace ',' text ', array (' label '=' gtc: 'mutated pass)' - & gt; Add ('IDGrade', 'unit', array ('class' =>,' examens \ ExamensBundle \ unit \ grade ',' property '=>' libGradeAr ')) - & gt; add' dateNominationGrade ('' Date '', array ('' year = '' ';' (',', ')' Add '-' ('prenomAr') - & gt; Add ('nomFr') - & gt; add ('prenomFr') - & gt; ('nomUtilisateur') - & gt; plus ('mottepepa') - & gt; Add ('idgrade') - & gt; Add ('date enrollment grade');}}    

__toString () method to add something like this:

  public function __to string () {return $ this-> nomAr;}   

This Sonata admin bundle will allow your current The name of the object will be used to display.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -