problems with template stored in DB
| From: | D. Sebastien Taggart | Date: | Wed, 01 Jan 2003 11:38:29 +0000 |
| Subject: | problems with template stored in DB | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6975@lists.php.net to get a copy of this message | ||
Hi All,
I have templates stored in a DB, but when I try to fetch or display them I
get an error. Here is the template:
{* Smarty *}
<p>This is a custom template stored in the database.</p>
<p>Title: {$title2)</p>
<p>Content: {$content2}</p>
I try calling it like this in the script:
$smarty->assign('title2','test title');
$smarty->assign('content2','test content');
$smarty->display("db:2"); // where 2 is the correct id in the DB
exit;
After which, I get an error like this:
Fatal error: Smarty: [in db:2 line 3]: syntax error: invalid attribute name
- '
Removing the template variables ({$title} and {$content}) causes the problem
to go away and the template displays as expected, so it doesn't seem like
there's anything wrong with Smarty getting the template, just parsing it
seems to cause a problem.
Can anyone shed some light on this one please?
Thanks in advance,
-dlst