feulf / raintpl3

The easiest Template Engine for PHP
https://feulf.github.io/raintpl
258 stars 57 forks source link

Number at the begin of a variable breaks template #140

Open dhardtke opened 10 years ago

dhardtke commented 10 years ago

Hi,

I know that it is probablly not intended to use variables with a number at the beginning, something like

3dmark11_benchmark

but this happens:

Parse error: syntax error, unexpected '3' (T_LNUMBER), expecting variable (T_VARIABLE) or '$'....

I would recommend to put a prefix in to the variables...

Thanks.

feulf commented 10 years ago

Hey, I prefer to disallow variables that starts with numbers {$1title}, but I agree that Parse error is an error that we want to avoid completely.

I'll check to see how complex this will be to implement. On your side you're more then welcome to open a pull request if you want to fix the error yourself.

Thanks

dhardtke commented 10 years ago

I think all the error messages look ugly (if they work, because sometimes they don't).. I will try to find a better way of showing them :)

So it should still be disallowed but just the Parse error should be catched?

feulf commented 10 years ago

Thanks!

From my iPhone

On Dec 13, 2013, at 12:47 PM, Dominik Hardtke notifications@github.com wrote:

I think all the error messages look ugly (if they work, because sometimes they don't).. I will try to find a better way of showing them :)

— Reply to this email directly or view it on GitHub.