Re: migration to 1.4.0
| From: | Monte Ohrt | Date: | Mon, 07 May 2001 21:38:41 +0000 |
| Subject: | Re: migration to 1.4.0 | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-698@lists.php.net to get a copy of this message | ||
I think my examples were wrong :-)
try this:
{section name=content loop=$elements.table}
{include file=$elements.table[content]}
{/section}
Monte Ohrt wrote:
>
> It doesn't look like you are looping through your data correctly. You
> must specify the table key somewhere.
>
> One or both of these should work:
>
> {section name=content loop=$elements.table}
> {include file=$elements[content]}
> {/section}
>
> {section name=content loop=$elements}
> {include file=$elements.table[content]}
> {/section}
>
> Holger Bahr wrote:
> >
> > I am coming from 1.3.2 and have trouble with 1.4.0 now
> >
> > I use an array like this:
> >
> > $elements = array("table" => array("001.tpl", "002.tpl"),
> > "name" => array("Welcome", "Sign up")
> > );
> >
> > wich represents 2 (or anyamount) Tables of an HTML Page.
> >
> > "Table" is the content and "Name" is the title of the Table.
> > The "name" part of each table looks quite the same all the time
> > so i separated the HTML in a file called "table_header.tpl"
> >
> > In 1.3.2, i could loop through $elements
> > (i use the loop for multiple file-includes):
> >
> > {section name=content loop=$elements}
> > {include file=$elements[content]}
> > {/section}
> >
> > and the loop opens 001.tpl and then 002.tpl.
> >
> > in each of those template files, i had another include statement
> > (directly on top for the part wich is always the same on every
> > table/template):
> >
> > {include file="table_header.tpl"}
> >
> > and in that table header, in that template, i drop the name of the table.
> > The old syntax was like:
> >
> > {$elements/name}
> >
> > Now my Question because {$elements[name]} does not work...
> >
> > In my Loop ...
> >
> > {section name=content loop=$elements}
> > {include file=$elements[content]}
> > {/section}
> >
> > ... how can i access the content of "name" in an included file ?
> >
> > $elements = array("table" => array("001.tpl", "002.tpl"),
> > "name" => array("Welcome", "Sign up")
> > );
> >
> > As i said, on 1.3.2 it works fine.
> >
> > Holger
> >
> > ---
> > You are currently subscribed to smarty as: monte@ispi.net
> > To unsubscribe send a blank email to $subst('Email.Unsub')
> > Visit Smarty's homepage at
> > http://www.phpinsider.com/php/code/Smarty/
>
> --
> Monte Ohrt <monte@ispi.net>
> http://www.ispi.net/
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/