SC-Networks / PHPTAL

PHP Template Attribute Language — template engine for XSS-proof well-formed XHTML and HTML5 pages
https://sc-networks.github.io/PHPTAL/
GNU Lesser General Public License v2.1
2 stars 2 forks source link

class properties in Context.php have to be prefixed #59

Closed usox closed 6 years ago

usox commented 6 years ago

tal creates internal properties in Context.php on the fly, so it can conflict with already existing properties like slots.

The following code tries to access slots and fails. After renaming the internal slots property, it works again. I guess that's the cause for the underscore-prefix in the original tal version. __set also checks explicitly for underscores in variable names before setting them

<div>
<span tal:omit-tag="" tal:repeat="slots SOMETHING">
<span tal:repeat="slot slots">FNA</span>
</span>
</div>