How to use_valuesin Twig

Asked

Viewed 123 times

0

Personal peercebi that when I pass some variable with _ in the name in Twig it of the error causing me to remove _ from the variable name to work.

How to hit you?

Ex. in PHP $data_birthday in TWIG: birthday

Thank you

  • How you are passing this value to the view?

  • In a simple way. Return $app['Twig']->render('list.Twig', ['passage' => ['birthday'=>'2000-01-01']); Ai on the TWIG page if I do so from error: {{ passage.data_anniversary }} if I do so it works {{ passage.databirthday }}

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.