using smarty for text files
| From: | Joris Trooster / Interstroom | Date: | Wed, 07 Feb 2001 14:05:44 +0000 |
| Subject: | using smarty for text files | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-68@lists.php.net to get a copy of this message | ||
I used Smarty for creating an text page instead of a html page.
I came across the following behaviour (example):
template_txt.tpl:
---------------------------------------------------
Contact:
Name: {$name}
Country: {$country}
And another line.
---------------------------------------------------
template_txt.php:
---------------------------------------------------
$template->assign("name","Joris Trooster");
$template->assign("country","Netherlands");
$template->display("template_txt.tpl");
---------------------------------------------------
The result is the following output:
---------------------------------------------------
Contact:
Name: Joris TroosterCountry: Netherlands
And another line.
---------------------------------------------------
There is no linefeed _after_ the template variables.
The compiled template is:
---------------------------------------------------
Contact:
Name: <?php print $name; ?>
Country: <?php print $country; ?>
And another line.
---------------------------------------------------
It seems like Smarty is doing the right job, but php is not...
I added an extra space _after_ the variable in the template, but it is
annoying :(
Regards,
Joris
NL