Re: php code in templates... how to?
| From: | olinux | Date: | Fri, 04 Oct 2002 06:36:31 +0000 |
| Subject: | Re: php code in templates... how to? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118813@lists.php.net to get a copy of this message | ||
eval() should work for you
http://www.php.net/eval
You also may want to consider including files coded
something like this:
<html>
<head><?=$headers;?></head>
<title><?=$title;?></title>
<body>
<?=$header;?>
<?=$body;?>
<?=$footer;?>
</body>
</html>
Then you just set the values for the vars in your code
- include the file.
Josh
--- Hendrik Daldrup <php-general@ring-wraith.com>
wrote:
> Hi,
>
> i am working with templates, which i put into a
> string ($user_screen)
> and in the end i make the output with
>
> echo $user_screen;
>
> where $user_screen would contain the template file
> data.
> However, if the $user_screen contains any php code
> it gets echo'ed as
> well, instead of parsed.
> (ok, that sounds logical),
> but is there a way i can make php parse the php code
> within this string?
>
> i thought, that maybe "include" would work that way,
> but its not
> possible to include a string, is it?
>
> thx
>
> Hendrik
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com