Re: block functions

From: Date: Thu, 21 Mar 2002 17:32:35 +0000
Subject: Re: block functions
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3217@lists.php.net to get a copy of this message
Custom Function came Block Function. Looks nice. IMHO, you should add the compiler of Block Function with Precedence higher than Post-Filter but lower than Custom functions. So, if someone use: page.php?name=ROBERTO+BERTO --------------------------------------------- {highlight bgcolor="#FF0000" color="#FFFFF" width="100%"} {$smarty.get.name} {/highlight} --------------------------------------------- Will print something like: --------------------------------------------- <table bgcolor=#FF0000 width=100%> <tr><td><div align=center><font color=#FFFFFF>ROBERTO BERTO</font></div></tr></tr></table> --------------------------------------------- plugin/block.highligh.php --------------------------------------------- function hightligh($args,$block) { $width = "100%"; $bgcolor = "#FFFFFF"; $color = "#000000"; extract($args); return sprintf(' <table bgcolor=%s width=%s> <tr><td><div align=center><font color=%s>%s</font></div></tr></tr></table>', $bgcolor,$width,$color,$block); } --------------------------------------------- Atenciosamente, ---------------------------------------- Roberto Bertó Under Development http://www.under.com.br Tel: 51 32270599 Cel: 51 91169628 ----- Original Message ----- From: "Andrei Zmievski" <andrei@ispi.net> To: <smarty@lists.ispi.net> Sent: Thursday, March 21, 2002 2:13 PM Subject: [smarty] block functions > I know that a lot of you have been asking for the {func} .. {/func} > style of custom template functions. I have a general idea about how to > implement them, but I can tell you that they will need to be a different > plugin type. So, what I need from you are suggestions for the name of > this new plugin. Somethin like 'blockfunction' or whatever. Carpe diem. > > -Andrei > > Commitment, n.: > Commitment can be illustrated by a breakfast of ham and eggs. The chicken > was involved, the pig was committed. > > --- > You are currently subscribed to smarty as: roberto@berto.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ > >

« previous php.smarty.general (#3217) next »