Re: PEAR Templates with embedded PHP code

From: Date: Tue, 11 Jun 2002 22:22:28 +0000
Subject: Re: PEAR Templates with embedded PHP code
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1624@lists.php.net to get a copy of this message
jcastagnetto@yahoo.com (Jesus M. Castagnetto) wrote in news:20020611212706.10891.qmail@web12107.mail.yahoo.com: > If you are going to add code to the templates, you are better off not > using templates and embedding php code in the HTML directly. The idea > of a template is to separate the form/display (template) from the > function/logic (php code). > > You might want to rethink your application logic and the approach you > need to use for your particular case. Perhaps what I need to do is assemble a template on the fly using the PEAR Template <!-- INCLUDE --> directive; I'd use regular PHP to create the sub- parts (it's a shame, though, that files included in this way aren't parsed by PHP just before inclusion). That might do what I need. Basically what I have is a chicken-and-the-egg problem: near the top of the output page is a graphic logo file which varies from page to page, and is created for each page using GD. However, other parts of the page prior to that need to know the height and width of that graphic (a bit of Javascript image preloading code, for example). -- e=sc^3 (shiva@io.com) Earl Cooley III

« previous php.pear.general (#1624) next »