PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
PHP & Smarty Templates Posted by silverCoder909 on 12 Jun 2012 at 10:47 AM
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;
}
$tpl->assign('result',$result);

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.

Note:
-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.


Report
Re: PHP & Smarty Templates Posted by Miskat on 11 Aug 2012 at 3:10 PM
Nice job... keep it up ... jquery integration with make it better ... can i use codecanyon with this ????????????



 

Recent Jobs