Re: [SMARTY-DEV] nested comments
| From: | Konstantin A. Pelepelin | Date: | Mon, 15 Dec 2003 08:44:55 +0000 |
| Subject: | Re: [SMARTY-DEV] nested comments | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1986@lists.php.net to get a copy of this message | ||
On Thu, 11 Dec 2003 09:05:40 -0800 (PST), Boots <jayboots@yahoo.com> wrote:
The reason is that once you've turned off small block, later you may want to turn off more.We could introduce a new commenting syntax for commenting large blocks of code, including normal comments. I think the syntax would most intuitively be {** **}.[snip]This would imply that you can't nest {** **} tags, but you could have several sets of them in one template. Well, it is not worth implementing if they anyway cannot be nested.
These are meant as *temporary* signals for debugging purposes Often it's more like "Nothing is more persistent than temporary"I know our designers. Before Smarty they even used HTML-comments to "turn off" template parts. The reason is they don't want to make extra moves when they'll need that parts back.
create a custom block function (I suggest naming it something like NOP) Seems to be reasonable. I'd name it {comment}{/comment}. It would be betterto have it as a compiler block function, but they are not implemeted. May be, I will use a prefilter, as recommended by Messju Mohr. There is another thing with nested blocks that is not critical but would be appreciated: keep track of proper block nesting and proper number of block open/close tags at compile time. That is the reason why I don't like {if 0}{/if}. Konstantin A. Pelepelin P.S. Thank you for this great software.