|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bananos Smarty n00b
Joined: 15 Dec 2008 Posts: 1
|
Posted: Mon Dec 15, 2008 8:40 pm Post subject: Przekazanie tablicy do tpl |
|
|
Witam,
Natrafiłem na pewien problem.
Pobieram z bazy tablice z danymi
Code: |
$sites = Klasa::pobierzJakiesWpisy();
foreach($sites as &$site)
{
$site['views'] = pobierzViews();
}
|
po zrobieniu var_dump na $site mam views w tablicy,
a po przekazaniu do tpl
Code: |
{foreach from=$sites key=i item=site}
<tr id="row{$i}">
<td id="idSite">{$site.idsite}</td>
<td id="views" class="views">{$site.views}</td>
</tr>
{/foreach}
|
dostaje bład
Undefined index: views in...
Ktoś ma pomysł?
Pozdrawiam |
|
Back to top |
|
fornve Smarty Rookie
Joined: 25 Apr 2008 Posts: 29 Location: Sheffield, UK
|
Posted: Tue Dec 16, 2008 11:20 pm Post subject: |
|
|
wklej tu co pokazuje var_dump |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|