To reduce the "WTF" effect of magically having javascript code that looks like flexy tags completely broken by the template engine, Flexy deliberatly turns the parser OFF when dealing with script contents (see Configuration Options for details of PHP in script tags)
As a result of this, it is not possible to put any flexy tags within blocks of javascript code. the flexy:tojavascript tag solves this in a way that enables javascript to be tested seperatly from the application, and also serves to encourage better coding practices. (eg. seperating your code with distinct lines of communication)
This feature depends on PEAR's HTML_Javascript Library
Example 41-1. A template with javascript and flexy:tojavasscript
|
Example 41-2. compiled template
|
Example 41-3. output from the Template (with no values set)
|