Hacker News new | ask | show | jobs
by ericwaller 6435 days ago
I've used smarty extensively at work, but I've always felt like I was fighting with the iteration constructs and odd choice of syntax.

I've always hated that in smarty, associative arrays are accessed with a dot. Associative array indices don't have to be valid php variable names, so what happens when you want to access $user['home-address'] in smarty?

1 comments

With Smarty 2.x you're left needing to do something like: {assign var=foo value="some string"} {$user[$foo]}

Smarty 3.x has a legitimate lexer/parser so the templates will be much more flexible. I think they finally realized that since they are compiling the templates anyway the parsing can be slow.