Re: [SMARTY] How to read a DB table from a template.
| From: | Simone | Date: | Wed, 02 Oct 2002 09:21:50 +0000 |
| Subject: | Re: [SMARTY] How to read a DB table from a template. | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6073@lists.php.net to get a copy of this message | ||
I know ... but the problems wan't read the language to display ... but read
from the DB the voices list for that language ... I couldn't have a DB
connection from a tpl file !
Now I have discovered that there is a include_php functin in Smarty ... if I
include a php file instead of a tpl file I can have a DB connection from
there ... but the problem now is the opposite ...
"How to pass a parameteres when I use a include_php statement ?"
Simone
On Wednesday 02 October 2002 11:11, you wrote:
> On Wednesday 02 Oct 2002 9:36 am, Simone wrote:
> > So i can't write
> >
> > If ($Lang = 'IT') then
> > read all the italian voices from the DB
> > If ($Lang = 'EN') then
> > read all the English voices from the DB
>
> Yes you can
>
> {if $lang =='IT}
>
> {/if}
>
> where lang is a smarty var
>
>
> JOhn