Monday, 15 September 2014

Adding custom Field to doctrine object in Controller -


I have a symfony2 project with an account unit. I have two features ID and description.

In my Controller I want to enrich Objekts to nominate my theory with an additional field name. This property will not be continuous and it will only be used in my twig template, I want to use {{account.name}} in the trig.

How can I specify the value of my objects in my controller, which can be used in the tag file?

Thank you, oh, it really is very simple: -)

I just can

Add

  $ entity-> Myproperty = "whatever I want";   

And then in my jogging template I use

  {{entity.myname}}   

Thanks anyway. .. I did not know that I can add properties like my objects in such a way.

No comments:

Post a Comment