PHP & Smarty Templates

I have my class

class Announcement
public $ID;
public $info;

public function __construct() { }

I use mysqli to interface with my database and create an array of objects

$result = array();
while( $row = $some_sth->fetch_object() )
$tmp = new Announcement();
$tmp->ID = $row->ID;
$tmp->info = $row->info;
$result[] = $tmp;

I want to output this array of objects in my smarty template but I cannot seem to figure out how. Any help would be appreciated.

-DB access is not the problem; I can echo out the array of objects just fine and output is as expected.

-smarty setup/configuration is fine. I can assign other variables and they display just fine.

Again, if anyone can help me get the array of objects to output in smarty, I'd really appreciate it.


  • Nice job... keep it up ... jquery integration with make it better ... can i use codecanyon with this ????????????
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion