multiple delimiters

From: Date: Tue, 21 May 2002 16:49:55 +0000
Subject: multiple delimiters
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4332@lists.php.net to get a copy of this message
In a number of lesser PHP template systems, and in non-PHP sytems like Perl's Template Toolkit (which is very much like Smarty otherwise) there's a nice feature that I don't see how to do in Smarty. The concept is that there are different but equivalent delimiters for template control structures and variable interpolation. For example: <!--{section name=customer loop=$custid }--> id: {$custid[customer]}<br> name: {$name[customer]}<br> address: {$address[customer]}<br> <p> <!--{/section }--> The idea is that anything that isn't meant to output text looks like an (X)HTML comment, and things that should output HTML look like placeholders. This makes for nice behavior in HTML editors and also when simply dropping a template into the browser to look at things. The problem with just using the comment syntax for everything is that when you preview a template in a browser during development, the page has blank spots where you'd rather get a look at placeholder values. This is especially true when previewing table rows, for example. I've taken a look through the Smarty source and don't easily see a way to do this. I'm also not certain what you would do for the {ldelim} and {rdelim} functions in the case of multiple delimiter choices. Any ideas? MSM

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