Re: Cleaning up my messy code

From: Date: Mon, 29 Sep 2003 23:07:25 +0000
Subject: Re: Cleaning up my messy code
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-164318@lists.php.net to get a copy of this message
* Thus wrote CPT John W. Holmes (holmes072000@charter.net): > From: "Brent Baisley" <brent@landover.com> > > > I looked into the templating systems at first, but really wanted to try > > what they were doing myself. It ends up being very easy to implement > > using output buffering. Just look into the ob_start() command. Here is > > an example of how I load a template file into a variable: > > ob_start(); > > include("templateFile.tpl"); > > $tpl_content = ob_get_contents(); > > ob_end_clean(); > > The only "problem" with a method like that is any PHP code in your template > file is evaluated. If you're the only one writing template files, you can be > careful, but any malicious PHP code that worked it's way into the template > could cause trouble. I wonder if now is a place to introduce my new templating system. I have the same difficulties in letting just joe blow executing php code within templates, sometimes smarty is just to smart for certain applications. Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#164318) next »