Re: [SMARTY] include_block

Paul Pogonyshev <[email protected]> Thu, 21 Dec 2006 22:44:09 +0200
Newsgroups gmane.comp.php.smarty.general
Message-ID <[email protected]>
[I assume this was meant for general public]

Allen Shaw wrote:
> Paul Pogonyshev wrote:
> > Hi,
> > 
> > I'd like to propose a block tag `include_block'.  ...
> > Or is it already possible with other tag?
> 
> How about:
> 
> {capture name=lorem}
> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
> eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
> enim ad minim veniam, quis nostrud exercitation ullamco laboris
> nisi ut aliquip ex ea commodo consequat.
> {/capture}
> 
> {include file="my-cute-side-block" contents=$smarty.capture.lorem}

Yes, it is possible.  However, I think it is not very clean since it
requires two tags and intention is less obvious from reading the code.
Proposed new tag doesn't really add new functionality, but should be
trivial to implement.  (Implementing it as plugin is not clean because
_smarty_include() is not exposed in the public interface.)

Paul

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php