Re: [SMARTY] problems with template stored in DB
| From: | Jason Sweat | Date: | Wed, 01 Jan 2003 16:16:06 +0000 |
| Subject: | Re: [SMARTY] problems with template stored in DB | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6976@lists.php.net to get a copy of this message | ||
<p>Title: {$title2)</p>
should be
<p>Title: {$title2}</p>
with a curly brace closing the smarty var.
Jason
----- Original Message -----
From: "D. Sebastien Taggart" <dlst@seblin.com>
To: <smarty-general@lists.php.net>
Sent: Wednesday, January 01, 2003 5:38 AM
Subject: [SMARTY] problems with template stored in DB
> 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
>
>
----------------------------------------------------------------------------
----
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php