Re: [SMARTY] what's struct of data you preferer to pass to smarty template?

From: Date: Fri, 10 Sep 2004 15:08:22 +0000
Subject: Re: [SMARTY] what's struct of data you preferer to pass to smarty template?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11802@lists.php.net to get a copy of this message
The idea of passing data to smarty is so that it can be done in a way that makes sense to whoever is designing the templates. So basically, whatever makes the most sense to you and your designer, or if you are doing the templates, whatever makes the most sense to you. Either way is just as good. Think too about if you will need to expand your templates later. -bok On Fri, 10 Sep 2004 20:46:21 +0800, Xuefer <xuefer@hotmail.com> wrote: > 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. > ); -- Xnyo - http://xnyo.odynia.org/

« previous php.smarty.general (#11802) next »