[PHPTAL] Multiple calls to use-macro and default slot
Bicou
phptal at bicou.com
Tue Oct 12 14:05:51 CEST 2010
It does not pass, but I figured out what make this happens, insert a
tal:define in the template :
<tal:block phptal:tales="php" *define="dummy 'dummy'"*>
<!--! definition of macro with a slot -->
<p metal:define-macro="the-macro">
The macro : <tt metal:define-slot="the-slot">the slot</tt>
</p>
<!--! call macro with default slot -->
<tal:block metal:use-macro="the-macro" />
<!--! call macro and fill the slot -->
<tal:block metal:use-macro="the-macro">
<tt metal:fill-slot="the-slot">something else</tt>
</tal:block>
<!--! call macro with default slot : this FAIL -->
<tal:block metal:use-macro="the-macro" />
</tal:block>
And now this adds a $tpl->pushContext() call, then the slot is filled in the
parent too, I see the line :
// setting slots in any context (probably violates TAL, but works around bug
with tal:define popping context after fillslot)
2010/10/12 Kornel Lesiński <kornel at aardvarkmedia.co.uk>
> On 12 Oct 2010, at 11:08, Bicou wrote:
>
> > When calling metal:use-macro multiple times, default slots don't get
> reinitialized.
>
> I've tested version in SVN and it passes test you've sent. Can you verify?
>
> svn co https://svn.motion-twin.com/phptal/trunk phptal
>
> --
> regards, Kornel
>
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL at lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/phptal/attachments/20101012/dc01c11d/attachment.htm
More information about the PHPTAL
mailing list