I came across this ticket on github:
https://github.com/bobthecow/mustache.php/issues/34#issuecomment-805892
The comment states:
"Note that use of pragmas is not recommended, but they're there if you feel like you need 'em."
I've never actually used Mustache but I am considering it for an upcoming project and I was wondering if its true that dot notation is bad practice for accessing array elements in Mustache. And if so, why?
Let me try to give that a bit more context :)
At the time that comment was written, Mustache (the templating language) did not support dot notation. It was, however, supported in several Mustache implementations (such as Mustache.php) as a pragma.
Because it wasn't part of the spec, support wasn't guaranteed in all instances: it was a non-standard extension to Mustache. Hence the warning about not relying on pragmas.
Since that time, dot notation has been added to the spec, and it is now supported across all spec-compliant mustache implementations.
So yes, by all means, use dot notation. It is a beautiful thing :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With