Re: Re: PHP Application Structre

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

 



At 10:00 AM -0400 5/11/10, Robert Cummings wrote:
Nathan Nobbe wrote:
i did gander at robs template system in interjinn once, but never got my
head wrapped round it; honestly i only gave it a day or so.  i prefer to go
the typical route as per above, and omit the bloat that systems like smarty,
savant etc bring to the table.

nothing personal david, just an anti-smarty rant :)

Interestingly, Paul makes a reference to "make" in an earlier post. Indeed I use my template engine in several ways. One of which is like make such that I use it to also generate configuration files for other projects. For instance, it's happened enough times where I've had to glue together multiple applications, each with their own configuration, and permissions nuances. I leverage one aspect of the template engine to build the configuration files for each project based on a single centralized master configuration (at least as regards paths and database settings). This means that I generally only change one configuration when adapting a build between dev, staging, and production. Additionally, I use other aspects of the template engine, such as post processing to properly set directory/file ownerships and permissions in different environments, perform W3C XHTML validation on generated pages, etc. This is functionality that was not originally intended but evolved as I realized that the template engine could do much more than just expand macros and tags. The engine is pluggable and allows declaring processing chains at various levels. Between dev, staging, and production I usually just do:

    svn update
    ./buildSite.php

And this installs InterJinn designed pages, InterJinn managed configurations, and InterJinn managed applications (such as Drupal, Joomla, MediaWiki, PHPMyAdmin, FengOffice, etc). Additionally, depending on need, I will generate templates for Drupal or MediaWiki using TemplateJinn since the template engine doesn't need to active at runtime. I can thus re-use simple tags for more complicated layout aspects like DHTML widgets.

In another scenario, I handle a fair amount of Government content these days and can use the government's own CLF2 compliant HTML templates to generate pages that use this layout with minimal modification. For instance, recently I had to work with an ASP template to embed various content and stuff, I just added a few InterJinn tags to include page title, meta tags, french/english flip links, and the content. Then I created the content pages. Finally, I run buildSite.php and generate the entire section of ASP pages (yes I know it's odd they use this particular style of content). It's very convenient that the tag that creates the flip link between french and english is target aware and can properly link the french named page to the english named page and vice versa. Similarly, in another Government project on which I worked, the government used another contractor (this kind of thing happens quite often in Canada due to competition rules) to markup their project's consultation document. To incorporate this other company's content into the site, I just added a custom template handler to copy/lightly modify the pages programmatically so that they could be embedded seemlessly into the site. Then I deliver everything to the client along with relative path resources upon which those pages rely. Requirements for PHP: zero -- Runtime processing: zero! But don't be mistaken in thinking it can only work to generate pages. It is also used to generate on-the-fly widget content or even email content.

Cheers,
Rob.

Rob:

If I could understand what the Hell you are talking about, I'd be a better programmer.

You're a bit like Einstein talking to a bunch of High School Physics Teachers. We nod our collective heads thinking "huh?" while hoping there isn't going to be a test.

If you want me to understand this stuff, you have to dumb down some.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
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