One idea that you might try. is XSL.
instead of doing %var1% and doing a replace. you can do things like
<xsl:value-of select="var1"/>
Doing this also completely separates presentation logic from the code.
you can do other fun things like loops also.
I will warn you by saying that XSL in the beginning is a real headache to 
figure out. but after you get things down, it's very nice.
I currently have things in my sites setup to init an Object that when echo'd 
will do the XSL translation for me.
After that all I do is gather the data into an XML document and stylize it.
Simplifies websites considerably. Gather the data you need... stylize it how 
you want it.. and if you want to swap out the entire layout on the fly.

On Saturday 05 November 2005 01:10 pm, Leonard Burton wrote:
> Greetings,
>
> HI All, I hope all is well.
>
> I have set up a template parser.  Basically, it parses the template
> and finds tags with tag_name.dat file and then includes the
> tag_name.dat file.  I have considered a few other options but as of
> now I think I like what I have come up with.
>
> The only problem that I have in my design is that I have to hard code
> tables in the dat file mixing php and html.  I would prefer to be able
> to do something like:
>
> [[tag with db query]]
> <table>
> <tr><td>colname</td><td>colname</td><td>colname</td></tr>
> <tr><td>%var1%</td><Td>%var2%</td><td>%var3%</td></tr>
> </table>
> [[/tag with db query]]
>
> I would like it to be able to parse the line with the %var1% (which is
> the column name with % or some other indicator on each side) in it and
> then have it generate how many ever rows as nessecary.
>
> Currently, my parsing engine loads the template, preg_splits() it so
> each template tag is on a new line, and then passes through the
> resulting array and executes the code for whatever tag is chosen.
>
> There are a couple ideas that I have thought of but have not thought
> of any real good way so I am turning to the list.
>
> Thanks for all of your help on this list!
>
> --
> Leonard Burton, N9URK
> [EMAIL PROTECTED]
>
>
> "The prolonged evacuation would have dramatically affected the
> survivability of the occupants."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to