<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 24 May 2012 18:24:21 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Project: Gitlist - A Git Repository Viewer (based on Silex & Twig)]]></title>
      <guid>http://www.phpdeveloper.org/news/17977</guid>
      <link>http://www.phpdeveloper.org/news/17977</link>
      <description><![CDATA[<p>
<i>Klaus Silveira</i> has submitted a project he's been working on to make browsing through git repositories a bit simpler with a local tool - <a href="https://github.com/klaussilveira/gitlist">gitlist</a>.
</p>
<blockquote>
GitList is an elegant and modern web interface for interacting with multiple git repositories. It allows you to browse repositories using your favorite browser, viewing files under different revisions, commit history, diffs. It also generates RSS feeds for each repository, allowing you to stay up-to-date with the latest changes anytime, anywhere. GitList was written in PHP, on top of the <a href="http://silex.sensiolabs.org/">Silex</a> microframework and powered by the Twig template engine. This means that GitList is easy to install and easy to customize. Also, the GitList gorgeous interface was made possible due to <a href="http://twitter.github.com/bootstrap/">Bootstrap</a>.
</blockquote>
<p>
Since it's just a PHP-based application, installing it is as easy as cloning the source to a web-accessible directory and setting up a "config.ini" file with your settings. You can find out more about this project based on the popular Silex microframework <a href="https://github.com/klaussilveira/gitlist">on its GitHub page</a>.
</p>]]></description>
      <pubDate>Fri, 18 May 2012 09:45:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Organzing Slim Framework Applications]]></title>
      <guid>http://www.phpdeveloper.org/news/17542</guid>
      <link>http://www.phpdeveloper.org/news/17542</link>
      <description><![CDATA[<p>
One of the more popular PHP microframeworks right now is <a href="http://www.slimframework.com/">Slim</a> and <i>Chris Hartjes</i> has <a href="http://www.littlehart.net/atthekeyboard/2012/02/14/organizing-slim-framework-apps/">a new post to his blog</a> about a good way he's found for organizing applications that use this handy tool.
</p>
<blockquote>
I've never really used a microframework in PHP before. I used <a href="http://flask.pocoo.org/">Flask</a> for a Python <a href="https://github.com/chartjes/liesitoldmykids">project</a> that I did to experiment with using Google App Engine. The principles seem to be quite similar (although I will admit that having decorators in PHP would be ineresting) but the trade-off with a microframework is that you usually have to figure out an application layout for yourself.
</blockquote>
<p>
He also uses the <a href="http://pimple.sensiolabs.org/">Pimple</a> dependency injection container, <a href="http://twig.sensiolabs.org/">Twig</a> templating and <a href="http://packagist.org/about-composer">Composer</a> for package management. He describes how he got it all set up - organizing the code so Composer could understand it, creating the Twig templates directory and creating some of his default routes.
</p>]]></description>
      <pubDate>Wed, 15 Feb 2012 08:57:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Twig extension]]></title>
      <guid>http://www.phpdeveloper.org/news/17151</guid>
      <link>http://www.phpdeveloper.org/news/17151</link>
      <description><![CDATA[<p>
In a new post from <i>Derick Rethans</i> he talks about <a href="http://derickrethans.nl/twig-extension.html">an extension version</a> of Twig, the popular <a href="http://twig-project.com">templating engine</a> from the creators of the Symfony framework.
</p>
<blockquote>
A while ago, Fabien asked me to have a look at porting one of Twig's slowest methods, TwigTemplate::getAttribute(), into a PHP extension. It is a complex method that does a lot of different checks and look-ups. Fabien's benchmarks showed that this method was responsible for quite a large amount of time. On top of that, it didn't seem that it could be optimised any further as PHP code itself.
</blockquote>
<p>
He points to <a href="https://github.com/derickr/twig-ext">the twig-ext extension</a> that's a reworked version of the "getAttribute" method from the tool and the performance gain (about 15%) it gives. Compiled templates will automatically call this new method in the extension. This update has already been merged into <a href="http://github.com/fabpot/Twig">the main Twig repo</a>.
</p>]]></description>
      <pubDate>Mon, 21 Nov 2011 08:35:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Smashing Magazine: Getting Started With PHP Templating]]></title>
      <guid>http://www.phpdeveloper.org/news/17005</guid>
      <link>http://www.phpdeveloper.org/news/17005</link>
      <description><![CDATA[<p>
On the Smashing Magazine site today there's a new post <a href="http://coding.smashingmagazine.com/2011/10/17/getting-started-with-php-templating/">introducing you to templating</a> in PHP applications. They cover both the creation of a simple, custom templating library as well as using a more widely known too - <a href="http://twig-project.org">Twig</a>.
</p>
<blockquote>
In this article, we'll cover how to separate the view of your PHP application from its other components. We'll look at why using such an architecture is useful and what tools we can use to accomplish this. [...] To fully benefit from this article, you should already know how to write and run your own PHP scripts on a Web server (i.e. using Apache).
</blockquote>
<p>
They start with the very basics of templating, mostly pointing out how it reduces the dependency of having layout code directly in your application's logic. It makes things easier to reuse and makes for better code structure in the long run. They mention other templating engines like <a href="http://www.smarty.net/">Smarty</a>, <a href="http://phptal.org/">PHPTAL</a> and <a href="http://www.twig-project.org/">Twig</a>, but focus in on the last for their code samples. They show basic templating, making reusable templates, applying filters and working with simple control structures.
</p>]]></description>
      <pubDate>Tue, 18 Oct 2011 09:15:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Rapid Application Prototyping in PHP Using a Micro Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/16818</guid>
      <link>http://www.phpdeveloper.org/news/16818</link>
      <description><![CDATA[<p>
On NetTuts.com today there's a new tutorial posted about <a href="http://net.tutsplus.com/tutorials/php/rapid-application-prototyping-in-php-using-a-micro-framework/">using a microframework for prototyping an application</a> you may not need a full stack framework to get running. Their examples are based on the <a href="http://www.slimframework.com/install">Slim</a> framework.
</p>
<blockquote>
Let's face it: we all have great ideas for a web application. Whether you write them down on paper or remember them using your eidetic memory, there comes a point when you want test whether or not your idea is really viable. In this tutorial, we'll use a micro framework, a templating language and an ORM to rapidly develop an application prototype.
</blockquote>
<p>
There's an introduction to help you get <a href="http://www.slimframework.com/install">Slim</a>, some <a href="https://github.com/codeguy/Slim-Extras">extras</a>, <a href="http://www.twig-project.org/installation">Twig</a> templating and <a href="https://github.com/j4mie/paris">Paris</a> and <a href="https://github.com/j4mie/idiorm">Idorm</a> set up and working happily together. There's code included for bootstrapping the application, creating a few routes, building models and using them to pull data from the database. They also create an "admin" area for their sample blog application, building an "add article" form and protecting it with a simple login system. You can <a href="http://nettuts.s3.amazonaws.com/1041_phprapidprototyping/code.zip">download the source</a> if you'd like to see it all working together.
</p>]]></description>
      <pubDate>Tue, 06 Sep 2011 09:56:57 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Joris de Wit's Blog: Extending different layouts for Ajax requests in Twig, Symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/16784</guid>
      <link>http://www.phpdeveloper.org/news/16784</link>
      <description><![CDATA[<p>
<i>Joris de Wit</i> has a (very) <a href="http://jorisdewit.ca/2011/08/27/extending-different-layouts-for-ajax-requests-in-twig-symfony2/">quick post</a> about a handy tip he found about switching layouts easily with <a href="http://twig-project.org">Twig</a> in his Symfony2-based application - a handy ternary sort of switch that can detect when something's an Ajax request.
</p>
<blockquote>
I just learned about the 'app' global variable in twig. It's very handy for loading a special layout for ajax requests.
</blockquote>
<p>
The "app" variable allows you get get back at some of the settings of your application and check on special things like the isXMLHttpRequest in his example. For more information about Twig and how you can add it to your application, check out <a href="http://www.twig-project.org/documentation">Twig-Project.org</a>. Using it's as simple as adding a phar.
</p>]]></description>
      <pubDate>Mon, 29 Aug 2011 11:39:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Creating Web Page Templates with PHP and Twig (part 2)]]></title>
      <guid>http://www.phpdeveloper.org/news/16302</guid>
      <link>http://www.phpdeveloper.org/news/16302</link>
      <description><![CDATA[<p>
On the Zend Developer Zone they've posted the <a href="http://devzone.zend.com/article/14158-Creating-Web-Page-Templates-with-PHP-and-Twig-part-2">second part</a> of <i>Vikram Vaswani</i>'s look at using the <a href="http://twig-project.org">Twig</a> templating engine in your PHP applications. In the first part of the series, he introduced the tool and got started with some simple examples. In this second part, he dives in deeper to some of the advanced features.
</p>
<blockquote>
In this second and concluding segment, I'll look at some of Twig's other features, including such goodies as template inheritance, custom filters and caching. If you enjoyed the first part of this article, keep reading to find out more about what goes on under Twig's hood, and how you can add even more power and flexibility to your templates
</blockquote>
<p>
He looks at template inheritance, parent blocks/child templates, data filtering, the tool's "compilation cache" and working with native plugins.
</p>]]></description>
      <pubDate>Thu, 05 May 2011 13:11:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ryan Mauger's Blog: Using Twig with Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/16297</guid>
      <link>http://www.phpdeveloper.org/news/16297</link>
      <description><![CDATA[<p>
<i>Ryan Mauger</i> has written up a new post about an integration he's done using the <a href="http://twig-project.com">Twig</a> templating engine (from be Symfony community) with his Zend Framework application to <a href="http://www.rmauger.co.uk/2011/05/using-twig-with-zend-framework/">make view handling simpler</a>.
</p>
<blockquote>
Mostly I thought [what Twig offered] were silly things that were not really needed unless you had a team of designers to work with, however, during my exploration, a couple of things occurred to me that I had not considered about templating systems before. One being the enforced separation of concerns they provide; you simply cannot do anything from inside them which you shouldn't be, keeping your presentation very very clean. The second, being that they're not all as terrible as Smarty.
</blockquote>
<p>
He helps you get Twig installed (via PEAR chnnel) and includes the code for an application resource and the changes you'll need to make to your application.ini to get things working. He uses a base controller setup, so he shows how to introduce a "twig()" method into that to help with rendering. Finally, there's a sample class included that includes two actions, both using this "twig()" method to pas the output data through the twig interpreter and out to the view.
</p>]]></description>
      <pubDate>Thu, 05 May 2011 08:28:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: 5 Popular PHP Template Engines Worth Checking Out]]></title>
      <guid>http://www.phpdeveloper.org/news/16168</guid>
      <link>http://www.phpdeveloper.org/news/16168</link>
      <description><![CDATA[<p>
On PHPBuilder.com today there's a new article looking at <a href="http://www.phpbuilder.com/columns/5-template-engines/Jason_Gilmore04072011.php3">five PHP templating engines</a> that they think are worth a look for use in your next project (or maybe in a current one).
</p>
<blockquote>
In this article I'll introduce five of PHP's most popular templating engines, providing you with a basis for continuing your own investigations. Keep in mind however that this list is by no means definitive; if you have experience using a templating engine not discussed here, please tell us about it in the comments!
</blockquote>
<p>The five template engines the author chose to spotlight are:</p>
<ul>
<li>Smarty
<li>Dwoo
<li>Twig
<li>Savant3
<li>PHPTal
</ul>
<p>
Each comes with a description of its major features and a code snippet or two showing it in use.
</p>]]></description>
      <pubDate>Fri, 08 Apr 2011 13:23:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Creating Web Page Templates with PHP and Twig (part 1)]]></title>
      <guid>http://www.phpdeveloper.org/news/16162</guid>
      <link>http://www.phpdeveloper.org/news/16162</link>
      <description><![CDATA[<p>
On the Zend Developer Zone today there's a new tutorial from <i>Vikram Vaswani</i> about <a href="http://devzone.zend.com/article/13633-Creating-Web-Page-Templates-with-PHP-and-Twig-part-1">using the Twig templating engine</a> in your application. It's part one of a series that introduces the library to you and includes examples of some of the most common templating logic.
</p>
<blockquote>
Most PHP frameworks, including Zend Framework, Agavi, CakePHP and CodeIgniter, come with built-in templating to enable this separation. However, if you're not a big fan of frameworks, or if your project is small enough that you don't need the additional overhead, you can also consider using a standalone template engine to obtain the same benefits. A number of such engines exist - you've probably already heard of Smarty, Savant, Dwoo and others - and in this article, I'll introduce you to one I discovered rather recently, called Twig.
</blockquote>
<p>
The <a href="http://twig-project.org">Twig</a> project gives you a framework-independent tool for creating simple (or complex, if you'd like) templates for the output of your site. He shows you how to get it installed (via PEAR) and provides some sample templates for things like:
</p>
<ul>
<li>using conditionals (if/else/etc)
<li>looping
<li>working with arrays from PHP
<li>including other templates
<li>using included filtering on data
</ul>]]></description>
      <pubDate>Thu, 07 Apr 2011 12:44:43 -0500</pubDate>
    </item>
  </channel>
</rss>

