Re: [SMARTY] Using different starting and ending delimiters
| From: | Matteo Di Giovinazzo | Date: | Thu, 20 Nov 2003 12:21:25 +0000 |
| Subject: | Re: [SMARTY] Using different starting and ending delimiters | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10569@lists.php.net to get a copy of this message | ||
Claas Diederichs wrote:
Hi, I would like to use both types of delimiters: <!--{}--> and {} for design reasons (put things like sction in <!-- to not display them in editors and variables in {} to display them) Is there a possibillity for using both? Thanks ClaasHi Claas, at <http://unipdleague.sourceforge.net/> we use two type of delimiters, <!--{ }--> and {{ }}. Here is the code for configuring Smarty: <code> function convert_delimiters($tpl_source, &$smarty) { return preg_replace("/{{(.*)}}/U", "<!--{\\1}-->", $tpl_source); } $smarty = new Smarty(); $smarty->left_delimiter = "<!--{"; $smarty->right_delimiter = "}-->"; $smarty->register_prefilter("convert_delimiters"); </code> Ciao! -- matteodg = mcquasar^2 = |keip| http://unipdleague.sourceforge.net/