RE: [SMARTY] Variables in includes
| From: | Renaud Binse | Date: | Thu, 25 Jul 2002 14:39:31 +0000 |
| Subject: | RE: [SMARTY] Variables in includes | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5444@lists.php.net to get a copy of this message | ||
Oops... thanks a lot ;o)
-----Message d'origine-----
De : Monte Ohrt [mailto:monte@ispi.net]
Envoye : jeudi 25 juillet 2002 16:36
A : Renaud Binse
Cc : smarty-general@lists.php.net
Objet : Re: [SMARTY] Variables in includes
Is that not what you expected? :-) use left braces "{" instead of left
parenthesis "("
Renaud Binse wrote:
> Hi,
>
> I've got a little problem with variable scope. Here is my code:
>
> Index.php:
> $smarty = new Smarty();
> $smarty->assign('title', 'Title');
> $smarty->assign('text', 'Test');
> $smarty->display('main.tpl');
>
> main.tpl:
> <HTML>
> <HEAD>
> <TITLE> {$title} </TITLE>
> </HEAD>
> <BODY>
> {include file="index.tpl"}
> </BODY>
> </HTML>
>
> index.tpl:
> ($text}
> <BR>
> ($title}
>
> On my browser I get :
> ($text} ($title}
>
> instead of "Test Title"
>
> Did I miss something ?
>
> Thanks a lot if you can help me...
>
>
--
Monte Ohrt <monte@ispi.net>
Director of Technology, ispi Inc.
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php