Re: Template style question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Give smarty a try rather than re-inventing the wheel


http://smarty.php.net




James



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
leonardburton@xxxxxxxxx


"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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux