|
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 |
beach_defender Smarty n00b
Joined: 24 Sep 2003 Posts: 2
|
Posted: Wed Sep 24, 2003 4:17 pm Post subject: arrays of objects (PEAR DB_DataObjects to be precise |
|
|
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 |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Wed Sep 24, 2003 4:55 pm Post subject: |
|
|
Um, you're returning true long before you get to the display call |
|
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
|