Last active
August 29, 2015 14:08
-
-
Save youssman/5bfdb42cbac4ad0fc438 to your computer and use it in GitHub Desktop.
escape HTML tags in phpTal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ... --> | |
<!-- You have to use ${structure expresssion} syntax to escape HTML tags. | |
The use of "tal:define" (to handle the case when no string is defined in the array) is important | |
because we can't combine the two PHPTALES "structure" and "string" in the same expression. --> | |
<div tal:define="myVarWithTags string:a br tag<br/>for example"> | |
${structure myArray/ofString | myVarWithTags} | |
</div> | |
<!-- ... --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment