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

arrays of objects (PEAR DB_DataObjects to be precise

 
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 -> General
View previous topic :: View next topic  
Author Message
beach_defender
Smarty n00b


Joined: 24 Sep 2003
Posts: 2

PostPosted: Wed Sep 24, 2003 4:17 pm    Post subject: arrays of objects (PEAR DB_DataObjects to be precise Reply with quote

Hi,
I am currently trying to build a listing program to display a list of incidents and I am using PEAR extensively.

I have list of DataObjects - eg

$i = $incident->find();
while ($incident->fetch())
{
$this->incidents[] = $incident;
}
return true;

$tpl =& new Smarty;
$tpl->debugging=true;

$tpl->template_dir = '../templates';
$tpl->compile_dir = '../templates_c';
$template='incidentList.tpl';
$tpl->assign('incidents',$this->incidents);
$tpl->display($template);
echo "Template Displayed<br>";

In the tenplate I have

{section name =id loop=$incidents}
<tr>
<td>{$incidents[id]->IncidentID}</td>
<td>{$incidents[id]->Date}</td>
<td>{$incidents[id]->Time} </td>
<td>{$incidents[id]->Location}</td>
<td>

</td>
</tr>

I get no output from the display() function at all.

Any clues?

Barry
Back to top
View user's profile Send private message
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Wed Sep 24, 2003 4:55 pm    Post subject: Reply with quote

Um, you're returning true long before you get to the display call
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 -> General 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