Re: [SMARTY] include_block
| From: | Max Schwanekamp | Date: | Thu, 21 Dec 2006 21:17:17 +0000 |
| Subject: | Re: [SMARTY] include_block | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-13651@lists.php.net to get a copy of this message | ||
Paul Pogonyshev wrote:
I'd like to propose a block tag `include_block'. {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>Couldn't this be done with register_block()? //quick example lacking error handling... <?php $smarty->register_block('include_block','include_block'); function include_block($params, $content, &$smarty, &$repeat) { if(!isset($content) || empty($content)) return; $smarty->assign('content',$content); return $smarty->fetch($params['file']); } ?> -- Max Schwanekamp NeptuneWebworks.com 541-517-9064