Re: [SMARTY] include and literal
| From: | David Förster | Date: | Thu, 04 Mar 2004 13:43:49 +0000 |
| Subject: | Re: [SMARTY] include and literal | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11051@lists.php.net to get a copy of this message | ||
Hello,
actually include is used to include other templates that should be
processed by smarty not to display contents of a file directly.
I think using readfile() as modifier should work if your security
settings allow that (file_get_contents() is even more elegant):
{$file|readfile} or {$file|file_get_contents}
hth
- david
> I have a log file, which I display like this:
>
> <pre>
> {include file="file:$file"}
> </pre>
>
> which works all well and good until the log file contains something
> like:
>
> {foobar}
>
> I then get a Smarty error about this "tag".
>
> Right now, I see two ways of handling this:
> (1) Run a modifier over the whole log file (which may be rather
> large)(2) Create a function like "include", but which will
> surround the
> content with {literal} tags.
>
> Any other option I am neglecting?
>
> Thanks,
> - Tony
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>