Re: Block functions

From: Date: Tue, 26 Mar 2002 08:18:07 +0000
Subject: Re: Block functions
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3341@lists.php.net to get a copy of this message
Hello, Andrei Zmievski wrote:
$content will be null for the opening tag so you can easily test whether you are being called for opening/closing tag by using isset($content).
What will it be when there's nothing between the tags? (for example, {table cols=3}{/table} Is it still possible to distinguish between start and end?
Block functions take precedence over custom functions with the same name. Also, you can pass attributes to the closing tag, e.g. {/table foo=yes}.
What about attributes passed to the opening tag, will they be passed to the closing tag as well? {table cols=3}stuff{/table} seems a logical thing to do, but would the cols param then be available in the closing tag, or do we have to use global vars to remember them? Isn't it possible to call the handler only once, with all parameters? Most of the time, you have 1 piece of output from a set of opening/closing tags. Also, I think it's going to be inconvenient that you don't have the contents in the start tag. Take for example {link url=http://www.phpinsider.com}Test{/link}. Only in the closing tag I know that there's something in between the tags, but in the opening tag, I would like to check that, so my opening will not generate the <a href=""> stuff. Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl

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