PHP XTemplate: Import Files

In the previous two tutorials on XTemplate, I discussed the basics of tag assignment and dealing with dynamic blocks, but the real power of using a templating system comes when you are able to use the same basic layout template on more than one page while displaying different content. XTemplate allows us to import template files into an existing template, allowing us to maintain a site structure on each page, but the true power comes when we need to make changes to the layout. Edit one file and the changes go into effect for all the pages using that template. Continue reading


PHP XTemplate: Multiple Dynamic Blocks

In PHP XTemplate: The Basics, I covered the basics for using the XTemplate engine. In this tutorial, I will cover using dynamic blocks to fill in information from a data source. For this tutorial, I will use an XML file for my data source. For more information on using PHP to read XML files, see my tutorials on Reading XML files with PHP. I will use the XML file created in the first part of that series. Continue reading

PHP XTemplate: The Basics

I have used FastTemplates for my PHP templating engine for years now, but it seems it is no longer supported. I still like it. It works well with some projects, but I decided maybe it was time to move on to something new. In my search, I came across a post from Web Resources Depot listing 19 PHP template engines. Some of these I knew (like Smarty), and most seemed more complicated than I needed. Let’s face it, I want to create web sites and develop PHP packages not learn a whole new markup system. Continue reading