RE: [SMARTY] Using smarty variables inside {php} {/php} blocks
| From: | Jorge Restrepo - WebTeam | Date: | Wed, 04 Sep 2002 20:50:05 +0000 |
| Subject: | RE: [SMARTY] Using smarty variables inside {php} {/php} blocks | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5928@lists.php.net to get a copy of this message | ||
I've got a similar question, but about using smarty variables in include_php
files.\
> -----Original Message-----
> From: Jaime Ashander [mailto:JaimeA@dis-corp.com]
> Sent: Wednesday, September 04, 2002 3:32 PM
> To: smarty-general@lists.php.net
> Subject: [SMARTY] Using smarty variables inside {php} {/php} blocks
>
>
> So, I think I may have had this working at one point, but now whenever I
> try it things go wrong.
>
> Example:
>
> Foo.php:
> ------------------
> <?php
> #my smarty is an innocent subclass that simply sets directories
> require_once 'my_smarty.inc';
>
> $smarty= new My_Smarty();
> $smarty->assign('bar', 'I want to be displayed');
> $smarty->display('foo.tpl');
> ?>
>
> Foo.tpl:
> ------------------
>
> <html>
> <body>
> <!-- random code-->
> Displayed via smarty:
> {$bar}
>
> <br>
>
> Displayed via php:
> {php}
> $bar
> {$bar}
> {/php}
> </body>
> </html>
>