For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > December 2006 > Re: [SMARTY] include_block









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] include_block
boots

2006-12-21, 7:08 pm

Hi.

I've never used it myself, but there is user contributed plugin at the wiki
that is something similar to what you propose:
http://smarty.incutio.com/?page=BlockWrapPlugin

It may be better to implement your own solution as a pair of compiler plugins
rather than a block plugin that the above plugin uses.

For myself, I'd rather see this done using the plugin features rather than as a
builtin.

Best regards,
boots

--- Paul Pogonyshev <pogonyshev@gmx.net> wrote:
> Hi,
>
> I'd like to propose a block tag `include_block'. It would work just
> like `include', but would additionally bind contents of the block to
> some reasonable name, e.g. $contents or $block. Name could also be
> specified by optional argument, but that might be an overkill.
>
> For instance,
>
> {include_block file="my-cute-side-block"}
> 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.
> {/include_block}
>
> And in file `my-cute-side-block':
>
> <div style="float: right; padding: 1ex;">
> $contents
> </div>
>
> Does that sound reasonable? Or is it already possible with other
> tag?
>
> Paul
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



________________________________________
__________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Paul Pogonyshev

2006-12-21, 7:08 pm

boots wrote:
> I've never used it myself, but there is user contributed plugin at the wiki
> that is something similar to what you propose:
> http://smarty.incutio.com/?page=BlockWrapPlugin


$smarty = clone($smarty)

I believe this is inefficient. May be wrong.

> It may be better to implement your own solution as a pair of compiler plugins
> rather than a block plugin that the above plugin uses.


It may well be as long as it can be done cleanly. If someone can propose a
clean plugin (or make _smarty_include public and with a better/more understandable
calling scheme), it should be no worse than original proposal.

Paul
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com