what's struct of data you preferer to pass to smarty template?
| From: | Xuefer | Date: | Fri, 10 Sep 2004 12:46:21 +0000 |
| Subject: | what's struct of data you preferer to pass to smarty template? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11801@lists.php.net to get a copy of this message | ||
hi guys, i'm 1st time here :)
here goes the question:
$smarty->assign("threads", $threads);
which struct of $threads u preferer?
option 1 (not modified result of rows from query):
$threads = array(
0 => array(
'threadid' => 1,
'title' => '123',
'forumid' => 1,
'forumname' => 'forum name',
'postername' => 'poster name',
'posterid' => 123,
.. etc ..
),
1 => ..etc.
);
option 2 (restructed):
$threads = array(
0 => array(
'threadid' => 1,
'title' => '123',
'forum' => array(
'id' => 1,
'name' => 'forum name',
),
'poster' => array(
'name' => 'poster name',
'id' => 123,
),
.. etc ..
),
1 => ..etc.
);