Re: Custom Template-Style Tags



hmmm...there are a bunch of ways to do this. your goal may better be served
through further oop abstraction such that you contain your business logic in
file/class "a" which is completely divorced of concern over html
generation...and, your html output has very little concern about your
business logic. loose-coupling.

anyway, i think tremendous work has been done to this end in the form of
"smarty". go to http://smarty.php.net/ and have a read. it's fairly easy to
use and accomplishes most of what you have described as what you'd like to
do...and gets you closer to the above described oop level of abstraction.

hth,

steve


"eddieroger" <eddieroger@xxxxxxxxx> wrote in message
news:1120104669.851912.220390@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Greetings to all,
|
| I am conceiving a nifty little templating engine (yeah, another one)
| for use in PHP applications. I have found that the code itself seems to
| be standard enough in the applications I do that I could potentially
| make my life a ton easier by being able to chunk code in different
| pieces, and use my own tags in a template style to call for code when
| need be. Similar to the early generations of MovableType when the code
| for HTML pages was generated through a CGI app that replaced their
| <$MT_something$> tags. I would like to do this in PHP, keeping the .php
| extension on my files and making it as non-invasive as possible. I'm
| thinking a standard include at the beginning of the pages, and my
| little snippets along the way.
|
| The problem I'm having is I don't know how to parse out for custom
| tags. I'm hesitant to just use functions everywhere since it defeats
| the purpose if I have to put <?php...?> everytime and call to a
| function, but as of right now, that's all I've got. I'm looking for
| suggestions - if you have any, I would greatly appreciate to hear them.
|
|
| Gratitude extended in advance.
|
| .eddieroger
|


.



Relevant Pages

  • simple MVC framework?
    ... I'm new to PHP... ... that keeps input field formatting only in the HTML files so that end- ... users can just mod the HTML, ... So long as the HTML name tags meet the Model metadata schema, ...
    (comp.lang.php)
  • Re: Question on using HTML within PHP documents
    ... by default php will output your html as normal if you close the tags. ... but contain HTML as a string definition. ...
    (comp.lang.php)
  • METAL in PHPTAL
    ... I was wondering if there was a way to include mutiple metal:use-maco tags ... The code i am using is the following (html) ... This code will read the htm files and output the data, but if i have php ...
    (comp.lang.php)
  • RE: [PHP] Check for well formed html
    ... You can use html tidy. ... I did this before the php tidy function was fully ... I have a client who wants to include html tags in his CMS. ...
    (php.general)