compile-block-functions (strip)
| From: | Nagger | Date: | Thu, 26 Jun 2003 21:33:09 +0000 |
| Subject: | compile-block-functions (strip) | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-1702@lists.php.net to get a copy of this message | ||
hi...
I was a little bit shocked to see that {strip}...{/strip} is executed at
display-time and not at compile time.
Then I found a post:
--------------------
From: "Monte Ohrt" <monte@ispi.net>
To: "Smarty Dev" <smarty-dev@lists.php.net>
Sent: Sunday, April 20, 2003 8:36 PM
Subject: [SMARTY-DEV] strip moved removed from core
{strip}{/strip} functionality was removed from the core and is now a
block function. This may have an affect on the output so please let me
know of any unexpected behavior. This makes strip logic simpler since it
is now operating on the template output instead of the source, which is
more correct IMHO.
--------------------
I realised that block-functions are always executed at display time.
But generally I would really like to see compiler_block_functions.
Are there any plans to introduce that?
To achieve this with the current system I would:
1. register two compiler_functions named {foo} and {/foo} which only insert
two magic-tags.
2. register a postfilter which processes all the content between the two
magic-tags.
This is a little bit problematic for nested blocks.
Is there a better way to do this right now?
bye...
Nagger