Re: [SMARTY-DEV] urgent: Passing PHP variables in SMARTY
| From: | messju mohr | Date: | Wed, 11 Feb 2004 16:15:13 +0000 |
| Subject: | Re: [SMARTY-DEV] urgent: Passing PHP variables in SMARTY | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2100@lists.php.net to get a copy of this message | ||
On Wed, Feb 11, 2004 at 05:54:50PM +0200, Muhammed Mamedov wrote:
> Hi everybody!
>
> I have a big problem here...
> I have a web site in PHP and want to convert it into SMARTY style.
>
> I have calls like this in my main file (old one, with no SMARTY):
> main.php?lang=en&cn=1
>
> How can I catch this variables in my template?
>
> I tried this and it didn't work:
> index.php (SMARTY based)
> $smarty->assign("portal",$lang);
>
> index.tpl
> {php} if(isset($lang)) { {/php} <h1>set lang!</h1> {php} } {/php}
???
i think if you want to implement your logic with {php}-tags then it's
less pain to do it in plain php and not use smarty at all.
try this:
{if isset($portal) } <h1>set lang!</h1> {/if}
> Any help appreciated!.
> Thanks from now!
>
> Regards,
> M.Mamedov