Re: [SMARTY] New and funny development
| From: | Andrei Zmievski | Date: | Fri, 31 May 2002 17:06:03 +0000 |
| Subject: | Re: [SMARTY] New and funny development | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4487@lists.php.net to get a copy of this message | ||
On Fri, 31 May 2002, Michael Stolovitzsky wrote:
> Now that with your help I beat Smarty (actually it's me who didn't read the
> manuals, I will be more careful about it from now on), there's a new
> interesting development: for some funny reason Smarty calls my block plugin
> function in reverse order. That means closing tag is processed before the
> opening tag. As a result the HTML output is something like </a><a>$content
>
> No, it's not the plugin function that's broken, as the function isn't stateful
> and doesn't care about the order of calls.
>
> Anyone has ideas about why it might be happening? I'm completely dazzled about
> whatever might be causing it, cause it's really weird ;)
>
> Smarty version is 2.2.1, unmodified, extracted directly from the tarball.
>
> Here:
>
> --- plugins/block.link.php
>
> function smarty_block_link($params, $content, &$smarty)
> {
> if ($content) {
> extract ($params);
>
> echo "<a href=\"?context=$context&command=$command\">$content";
> }
>
> else return '</a>';
> }
$content is set only for the ending tag, so you should reverse the test.
-Andrei http://www.gravitonic.com/
For society, it's probably a good thing that engineers value function over
appearance. For example, you wouldn't want engineers to build nuclear power
plants that only _look_ like they would keep all the radiation inside.
(Scott Adams - The Dilbert principle)