Aquileo | Recent changes to feature-requestshttps://sourceforge.net/p/php-templates/feature-requests/Recent changes to feature-requestsenThu, 05 Jun 2003 15:43:16 -0000Aquileo | Native OO Interface.https://sourceforge.net/p/php-templates/feature-requests/3/<div class="markdown_content"><p>Another thing I'd like to see is a native oo interface<br /> for this extension. I've attached an php code example<br /> of how such an interface would look (The extensions in<br /> there can be disregarded).</p> <p>eg:<br /> &amp;lt;?php</p> <p>$t = new tmpl();<br /> $t-&amp;gt;open('test.tpl');<br /> $t-&amp;gt;set_global('random', mt_rand());<br /> for ($i = 0; $i &amp;lt; 4; $i++) {<br /> $t-&amp;gt;iterate('/row');<br /> $t-&amp;gt;set('/row', array('one' =&amp;gt; '1', 'two' =&amp;gt; '2'));<br /> }<br /> echo $t-&amp;gt;parse();</p> <p>?&amp;gt;</p> <p>Regards, Sjon</p></div>SjonThu, 05 Jun 2003 15:43:16 -0000https://sourceforge.net9fcd42ea1412143d57e53a0939df1285219a423bAquileo | Ability to register callback functions.https://sourceforge.net/p/php-templates/feature-requests/2/<div class="markdown_content"><p>Hi.</p> <p>I've made my own templating function library in php (who <br /> hasn't), and added besides the standard replacement <br /> stuff also a way to incorporate so called tags inside <br /> templates, wich can be assigned a handler.<br /> Example:<br /> // the tag wich can be put inside a template<br /> &amp;lt;tag:random min=&amp;quot;100&amp;quot; max=&amp;quot;999&amp;quot; /&amp;gt;</p> <p>// registering a handler with a tag<br /> stpl_register_tag<br /> (STPL_FETCH_EVENT, 'random', 'stpl_tag_random');</p> <p>// example function<br /> function stpl_tag_random ($params) {<br /> $min = (isset($params['min']) ? $params['min'] : 0);<br /> $max = (isset($params['max']) ? $params['max'] : <br /> mt_getrandmax());<br /> return mt_rand($min, $max);<br /> }</p> <p>the STPL_FETCH_EVENT is one of three events that <br /> occur. In order:<br /> STPL_LOAD_EVENT: when the template get's read <br /> from disk<br /> STPL_PARSE_EVENT: when the template get's parsed <br /> (variable substitution)<br /> STPL_FETCH_EVENT: when the parsed content get's <br /> fetched for display/storage</p> <p>Now, I know the event stuff may not really make sense <br /> with this extension (maybe the first two do), but I would <br /> love to see something like this incorporated into this <br /> extension.<br /> I'm no C programmer, so I can't be of much use in that <br /> field, but I would love to help. I think one additional <br /> function and two ini entries (tag_start and tag_end) <br /> would be all that's needed. Maybe even add a few <br /> predefined tag handlers (like above random, date, <br /> include), etc.</p> <p>If you've got any questions, let me know.</p> <p>Regards, Sjon.</p></div>SjonTue, 20 May 2003 08:32:13 -0000https://sourceforge.net790ede2f3b35490d878a129ab6d45cd434269c87Aquileo | replacing multiple tokenshttps://sourceforge.net/p/php-templates/feature-requests/1/<div class="markdown_content"><p>Could it be possible to replace all of the occurences<br /> of a same token in a context with only one assign?<br /> ex:<br /> &amp;lt;pre&amp;gt;<br /> &amp;lt;tmpl:blah&amp;gt;</p> <p>&amp;lt;a href=&amp;quot;index.php?do=erase&amp;amp;id={ID}&amp;quot;&amp;gt;<br /> &amp;lt;a href=&amp;quot;index.php?do=modify&amp;amp;id={ID}&amp;quot;&amp;gt;</p> <p>&amp;lt;/tmpl:blah&amp;gt;<br /> &amp;lt;/pre&amp;gt;</p> <p>Thanks</p></div>ClementMon, 11 Mar 2002 13:18:12 -0000https://sourceforge.netb0002a5ca21646d8b5e23fb1eea17bd04cd1ad08