HTML_Template_Flexy updates
Published 2003-10-12 11:23:05
demian from PHPkitchen uses my template engine in his framework (hehe we all have one of those..) anyway - he was upgrading from the original early version to the current CVS one. Which has a tokenizer and is a 2 part parser/compiling system.. (pretty awesome really)
Two of the things problems he found where
a) includes
Includes in the old engine used {include:#xxxx.html#}, I disabled this for numerous reasons in the new engine, but have been tempted into bringing it back. The current thought on it is this:
<flexy:include src="xxx.html" />
of course if you really want to get clever with it you can do things like
<flexy:include src="xxx.html"><B>xxx.html goes here</b></flexy:include>
which will display xxx.html goes here whey you edit the template in a WYSIWG editor - and disappears when compiled..
b) javascript and scripts.
You can not use flexy tags {varname} in javascript blocks surrounded by <script></script>, as the whole thing gets too messy with it accidentally replacing stuff it shouldnt..
So if you need to send variables to javascript you can use
<flexy:toJavascript flexy:prefix="xxxxx_"
abc="xyz"
bcd="wxy"
/>
this is turned into php code that converts $object->xyz into xxxxx_abc in javascript
eg. in php
$this->xyz = 1234;
$this->wxy = "hello"
$flexy->outputObject($this);
using the above tags - it ends up at the browser as
<script language="javascript">
var abc = 1234;
var bcd="hello";
</script>
Two of the things problems he found where
a) includes
Includes in the old engine used {include:#xxxx.html#}, I disabled this for numerous reasons in the new engine, but have been tempted into bringing it back. The current thought on it is this:
<flexy:include src="xxx.html" />
of course if you really want to get clever with it you can do things like
<flexy:include src="xxx.html"><B>xxx.html goes here</b></flexy:include>
which will display xxx.html goes here whey you edit the template in a WYSIWG editor - and disappears when compiled..
b) javascript and scripts.
You can not use flexy tags {varname} in javascript blocks surrounded by <script></script>, as the whole thing gets too messy with it accidentally replacing stuff it shouldnt..
So if you need to send variables to javascript you can use
<flexy:toJavascript flexy:prefix="xxxxx_"
abc="xyz"
bcd="wxy"
/>
this is turned into php code that converts $object->xyz into xxxxx_abc in javascript
eg. in php
$this->xyz = 1234;
$this->wxy = "hello"
$flexy->outputObject($this);
using the above tags - it ends up at the browser as
<script language="javascript">
var abc = 1234;
var bcd="hello";
</script>
Extend me!
Both of these are contained in the HTML_Template_Flexy_Compiler_Standard_Flexy class. The idea of this directory is clever - if you want to create your own namespace tags: eg. <mytag:test xxx="tttt"> all you need to do is create a file in the Standard folder called Mytag.php and implement testToString() method.
Mentioned By:
google.com : HTML_Template_Flexy (106 referals)
google.com : flexy include (104 referals)
google.com : flexy:include (80 referals)
google.com : flexy javascript (55 referals)
google.com : april (49 referals)
google.com : december (46 referals)
google.com : flexy xxx (39 referals)
google.com : HTML_Template_Flexy include (15 referals)
google.com : HTML_Template_Flexy javascript (14 referals)
google.com : xxx flexy (14 referals)
google.com : <flexy:include (8 referals)
google.com : php flexy include (7 referals)
google.com : "flexy:include" (5 referals)
google.com : flexy:include variable (5 referals)
google.com : PHP flexy (5 referals)
google.com : "<flexy:include" (4 referals)
google.com : <flexy:include src (4 referals)
google.com : flexy include php (4 referals)
google.com : flexy include variable (4 referals)
google.com : flexy javascript variables (4 referals)
google.com : HTML_Template_Flexy (106 referals)
google.com : flexy include (104 referals)
google.com : flexy:include (80 referals)
google.com : flexy javascript (55 referals)
google.com : april (49 referals)
google.com : december (46 referals)
google.com : flexy xxx (39 referals)
google.com : HTML_Template_Flexy include (15 referals)
google.com : HTML_Template_Flexy javascript (14 referals)
google.com : xxx flexy (14 referals)
google.com : <flexy:include (8 referals)
google.com : php flexy include (7 referals)
google.com : "flexy:include" (5 referals)
google.com : flexy:include variable (5 referals)
google.com : PHP flexy (5 referals)
google.com : "<flexy:include" (4 referals)
google.com : <flexy:include src (4 referals)
google.com : flexy include php (4 referals)
google.com : flexy include variable (4 referals)
google.com : flexy javascript variables (4 referals)
Follow us
-
- Some thoughts on the language server and its usefulness in the roobuilder
- Roo Builder for Gtk4 moving forward
- Clustered Web Applications - Mysql and File replication
- GitLive - Branching - Merging
- PDO_DataObject Released
- PDO_DataObject is under way
- Mass email Marketing and anti-spam - some of the how-to..
- Hydra - Recruitment done right
Blog Latest
-
Twitter - @Roojs