Re: {section} question
| From: | Andrei Zmievski | Date: | Wed, 28 Feb 2001 16:13:25 +0000 |
| Subject: | Re: {section} question | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-239@lists.php.net to get a copy of this message | ||
On Wed, 28 Feb 2001, Maciek Uhlig wrote:
> let's assume we have 3 levels of nested sections. We have to structure our
> data in the following way:
>
> $level1_name = array(...);
> $level2_name = array(array(...));
> $level3_name = array(array(array(...)));
>
> and then assign them to the template:
>
> $smarty->assign($template_level1_name, $level1_name);
> $smarty->assign($template_level2_name, $level3_name);
> $smarty->assign($template_level3_name, $level3_name);
>
> The more template names, the more assigns. The more section levels, the more
> nested arrays.
>
> I don't like it although I already figured this out and can effectively use
> it. But I'd like to have something more simple and obvious.
>
> Would the following work?
>
> $names = array("name1"=>$level1_name, "name2"=>$level2_name,
> "name3"=>$level3_name);
> $smarty->assign($template_names, $names);
Well, this would assign three template variables. What did you try to do
with this?
-Andrei
"Later in this talk, I intend to define
the universe and give three examples." -- Larry Wall