For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > August 2004 > Re: [SMARTY] RE: Assigning to variables









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] RE: Assigning to variables
Jake Stride

2004-08-19, 3:58 am

Thanks this should work, but how would I go about concatinating the output
to another value? Ie I want to build up a string:

$var = $var1.$var2;

{section name=dataloop loop=$data}
{capture name="cap"}

{$data[dataloop].FOO}

{/capture}
{$catCap|cat:$smarty.capture.cap}
{/section}

{$catCap}

On 18/8/04 10:44 pm, "Lambert, Patrick" <Patrick.Lambert@noggin.com> wrote:

> Capture should work...
> http://smarty.php.net/manual/en/lan...p#LANGUAGE.FUNC
> TION.CAPTURE
>
> You can dynamically name your capture by concatenating the section index
> value into it....
>
> {section name=dataloop loop=$data}
> {capture name="cap"|cat:$smarty.section.dataloop.index}
>
> {$data[dataloop].FOO}
>
> {/capture}
> {/section}
>
> {$smarty.capture.cap0}
> {$smarty.capture.cap1}
>
> p.
>
>

Sponsored Links







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

Copyright 2008 codecomments.com