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
Patrick Lambert

2004-08-19, 4:07 pm

Sorry, I though you wanted to capture each iteration individually.
But your catCap example looks like it does what you want, no? Alternately,
if you just want to capture everything at once, you can move the capture
outside the section.
After the capture you are free to concatenate $catCap or $smarty.capture.cap
onto whatever else you want
(http://smarty.php.net/manual/en/lan...odifier.cat.php).

p.

> ----------
> From: Jake Stride
> Sent: Thursday, August 19, 2004 3:10 AM
> To: Lambert, Patrick; smarty-general@lists.php.net; 'Jake Stride'
> Subject: Re: [SMARTY] RE: Assigning to variables
>
> 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:
>
> http://smarty.php.net/manual/en/lan...php#LANGUAGE.FU
> NC
> seem
> problem
> them
> href="{$serverRoot}/?{$sessionName}={$sessionValue}&module={$view_data
> iew].newmodule}&function={$view_data[view].newfunction}&sub={$view
> ata[view].newsub}&type={$view_data[view].newtype}&view={$view_data
> href="{$serverRoot}/?{$sessionName}={$sessionValue}&module={$view_data
> iew].newmodule}&function={$view_data[view].newfunction}&sub={$view
> ata[view].newsub}&type={$view_data[view].newtype}&view={$view_data
> need
>
>


Sponsored Links







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

Copyright 2008 codecomments.com