News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Hernani Cerqueira's Blog:
XSLT as a templating engine for PHP
January 05, 2010 @ 10:12:57

Hernani Cerqueira has posted a quick introduction to using XSLT (an XML-based markup for styling XML documents) as a templating engine for PHP.

One thing that I miss is a good unobtrusive template engine for PHP. Of course there is smarty, and a bunch of pear packages as well as some other free or commercial projects, and I'm honest to say that I'd never tried none of these, simply because I still see XSLT as a perfectly valid and powerful solution This post is a small tutorial about using XSLT as a templating engine for PHP.

He takes some time to explain what XSLT is and why it's a good choice (from his opinion) for templating your site. A code example is included where he builds a simple XML document (with the DOMDocument functionality of PHP) and creates a XSLT style sheet to take that information and change it into a formatted HTML document. Outputting the result is easy with the creation of a new XSLTProcessor object and a push out the other side with a transformToXML method call.

0 comments voice your opinion now!
xslt template language tutorial


blog comments powered by Disqus

Similar Posts

SitePoint Web Foundations Blog: Quick Tip: Install Zend Server 7 on an Ubuntu 14.04 Vagrant Box

WebSpeaks.in: Cross Domain Posting using PHP and JavaScript: ITS POSSIBLE!

PHP Manual Masterpieces: PHP 2.0: A Review in Retrospect

Tutorialzine.com: Creating a PHP and CSS3 Powered About Page

NetTuts.com: Language War: PHP vs. Ruby


Community Events





Don't see your event here?
Let us know!


community introduction bugfix library framework interview code language release laravel application developer podcast api series list threedevsandamaybe wordpress project configure

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework