简体   繁体   中英

Symfony Twig Rendering

I am trying to bind variables with symfony template like {{ 2ctc5qxi }} {{ !applianceType_page2_5 }} . but i am getting error

Unexpected token "name" of value "ctc5qxi" ("end of print statement" expected)

But it is working fine with keys, that does not starts with numbers & special characters.Please help in this.

PHP variables can't start with a number. So make sure that name of variables is as per convention defined here. PHP Variables Basics

Just rename your variable 2ctc5qxi with something that starts with a letter or an underscore. Can't start with a number. As a regular expression, it would be expressed thus: '[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*' .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM