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