Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Przekazanie tablicy do tpl

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Polish
View previous topic :: View next topic  
Author Message
bananos
Smarty n00b


Joined: 15 Dec 2008
Posts: 1

PostPosted: Mon Dec 15, 2008 8:40 pm    Post subject: Przekazanie tablicy do tpl Reply with quote

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
View user's profile Send private message
fornve
Smarty Rookie


Joined: 25 Apr 2008
Posts: 29
Location: Sheffield, UK

PostPosted: Tue Dec 16, 2008 11:20 pm    Post subject: Reply with quote

wklej tu co pokazuje var_dump
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Polish All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP