RE: [SMARTY] One Question
| From: | Gary Loescher | Date: | Sat, 01 Jun 2002 03:56:23 +0000 |
| Subject: | RE: [SMARTY] One Question | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4491@lists.php.net to get a copy of this message | ||
Welcome Alex.
I can't re-create your problem; it works fine for me.
What versions of Smarty and PHP are you using?
Gary
>-----Original Message-----
>From: Alex ILINSKI [mailto:alex@nomicrosoft.ru]
>
<snip>
>So, here is my problem. First of all, I register a block in my PHP file:
>
><?
>$smarty->register_block ("edt", "do_design_table");
>
>function do_design_table ($params, $content, &$smarty)
>{
> if ($content != "")
> print ("<table
> border=5><tr><td>$content</td></tr></table>");
>}
>?>
>
>Then, I put this in my smarty template:
>{edt}Hello, world{/edt}
>
>It works pretty well - I have a nice table with "Hello World" inside.
>
>Next, I try something more complicated:
>
>{edt}
>{foreach from=$arr item=currval}
>$currval
>{/foreach}
>It was the contents of "arr" array.
>{/edt}
>
>And with this construction, I have serious troubles. In the
>output, I have the
>"arr" values displayed ABOVE the table, and only the "It was th
>contents..."
>string goes inside.
>
>Does somebody know what's the problem? I will be glad of any
>answer. Thank you
>in advance and good luck!
>