If you ever used Flexy, which I consider a really great TE, you have most probably already stumbled across Flexy's inability to step into <script> blocks.
A really easy method to overcome this problem is to define scriptOpen and scriptClose properties in your base objects outputted by Flexy:
<?php
class FlexyObject {
var $scriptOpen = "\n<script type=\"text/javascript\"> <!--\n";
var $scriptClose = "\n//--> </script>\n";
var $scriptData = "var foo = 'bar';";
}
?>
Outputting above object with the following template wont work:
<html>
<script type="text/javascript">
{scriptData:h}
</script>
</html>
Instead:
<html>
{scriptOpen:h}
{scriptData:h}
{scriptClose:h}
</html>
...works like a charm...
Alan said, Flexy wont step into Javascript blocks because that caused massive problems with the Smarty convertor...
<flexy:toJavascript
javascript_varname="php_var_name">
<script type="text/javascript">
javascript_varname="the default";
</script>
</flexy:toJavascript>
So that templates can be tested independantly of the renderer..
(otherwise use XMLUrlRequest to fetch data)
But I guess there should be some way to write generated Javascript.. perhaps
<script type="text/javascript" flexy:code="{myjscode():h}">
javascript_varname="the default";
So that templates can be tested independantly of the renderer..
(otherwise use XMLUrlRequest to fetch data)
But I guess there should be some way to write generated Javascript.. perhaps
ohh - I hate smart comment systems
I would of course prefer that Flexy would step seemlessly into blocks