Use of PHP-Code in Smarty-Variables

From: Date: Sat, 12 Jun 2004 18:15:30 +0000
Subject: Use of PHP-Code in Smarty-Variables
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11454@lists.php.net to get a copy of this message
Hi, I am transporting my old Homepage to a new one with a Design. Therefore I have to use Templates. So, I have to put into one variable {$text} the old, mostly HTML, Code. I assign it like this: $smarty->assign('text', implode(file("start.php"))); But when I tried to transport my guestbook, or other scripts with PHP inside, into Smarty, nothing happens. Here an example: in the test.php is written: <h1>This is a Test</1> This is a test message<br> <? $variable = "<br>php-testmessage"; echo $variable; ?> End of Test When I assign it $smarty->assign('text', implode(file("test.php"))); In the document is only this displayed: This is a Test This is a test message End of Test But when I look into the quell code, I can see what I have written. What can I do, to make smarty to execute the PHP-commands? Christian Arnold PS: I am German, so please excuse my English :)

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