Map Class variable in Twig templates
Hello.
First of all, I am Braziliam and I'm not good in English, so sorry about errors in the text.
I had one issues last night, I was working with Twig, using the Twig Support Plugin. In my Symfony project, I created two actions, with two view templates.
My first action is named "route", and to his template I pass the "routes" variable, that is an array of RouteClass. In Twig template I did a "for" to print all routes, this action / template works fine, the autocomplete works fine with the RouteClass variables.
The second action is named "role", she works with same way of first action, but with my roles. In the "for", in Twig template, the auto complete still suggesting variables of RouteClass, but this variable is one RoleClass.
There is a way in Twig that I say that "routes" variable is a RouteClass and the "roles" variable is the RoleClass
Thanks.
Please sign in to leave a comment.
Would it be possible to attach those action & view template files?
Here is the "role" action code. The "route" action code is exactly the same, the only difference is that variables "roles" and "role" are "routes" and "route", and in the table, "description" is "url". In this attribute I could see the error, in the "route" he suggest the "description" attribute instead "url" attribute.
Thank you very much for the help.
Unfortunately there's no way to achieve that currently, please leave your vote here:
https://youtrack.jetbrains.com/issue/WI-28093#focus=streamItem-27-1279182-0-0