<?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, 23 May 2013 00:11:02 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney's Blog: Cgiapp2 Tutorial 2 - Pluggable Applications]]></title>
      <guid>http://www.phpdeveloper.org/news/5533</guid>
      <link>http://www.phpdeveloper.org/news/5533</link>
      <description><![CDATA[<p>
<i>Matthew Weir O'Phinney</i> has created <a href="http://weierophinney.net/matthew/archives/118-Cgiapp2-Tutorial-2-Pluggable-Applications.html">yet another tutorial</a> surrounding the <a href="http://weierophinney.net/phly/index.php?package=Cgiapp2">Cgiapp2software</a> and looks this time at something he calls "pluggable applications".
</p>
<p>
He gives the example of needing a method for creating a well-structured layout in his appication, but also needing a sitewide template to apply to it. Traditional methods don't quite lend themselves to that, so he introduces a new function, <a href="http://cgiapp.sourceforge.net/cgiapp2_doc/Cgiapp2/Cgiapp2.html#methodcgiapp_postrun">cgiapp_postrun</a>, to apply the template after the logic is through.
</p>
<p>
He <a href="http://weierophinney.net/matthew/archives/118-Cgiapp2-Tutorial-2-Pluggable-Applications.html">includes two examples</a>, one demonstrating the above mentioned situation and the other showing how to make a flexible method for including authentication in only certain parts of the application and not others. Both define a postrun() function to handle the changes to be made after the rest of the logic has finished.
</p>]]></description>
      <pubDate>Wed, 07 Jun 2006 06:17:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney's Blog: Cgiapp2 Tutorial 1 - Switch Template Plugins at Will]]></title>
      <guid>http://www.phpdeveloper.org/news/5517</guid>
      <link>http://www.phpdeveloper.org/news/5517</link>
      <description><![CDATA[<p>
Right on the tails of a new release of the <a href="http://weierophinney.net/phly/index.php?package=Cgiapp2">Cgiapp set of libraries</a>, <i>Matthew Weir O'Phinney</i> has posted <a href="http://weierophinney.net/matthew/archives/117-Cgiapp2-Tutorial-1-Switch-Template-Plugins-at-Will.html">a first tutorial</a> in a series covering its usage. In this tutorial, he looks at a creating a "template switcher" for Cgiapp2-based applications.
</p>
<quote>
<i>
<p>
Cgiapp2 implements a new callback hook system, which is basically an <a href="http://en.wikipedia.org/wiki/Observer_pattern">Observer pattern</a>. Cgiapp2 has a number of registered hooks to which observers can attach; when a hook is triggered, each observer attached to it is notified and executed.
</p>
<p>
Why all this talk about hooks? Because in Cgiapp2, the various template actions -- initialization, variable assignment, and rendering -- are relegated to hooks. For simplicity's sake, and for backward compatibility, you can use the functions tmpl_path(), tmpl_assign(), and load_tmpl() to invoke them; you could also use the generic call_hook() method to do so, passing the hook name as the first argument.
</p>
</i>
</quote>
<p>
To make it simpler for developers to access this templating system, <i>Matthew</i> created the <a href="http://weierophinney.net/phly/darcs/annotate/cgiapp/Cgiapp2/Plugin/Template/Interface.class.php">Cgiapp2_Plugin_Template_Interface</a>, a standardized interface for the template plugins. It's this interface that he demonstrated an example of, giving only a few lines of code (all that's needed) to switch between Smarty and Savant templating systems.
</p>]]></description>
      <pubDate>Tue, 06 Jun 2006 05:47:28 -0500</pubDate>
    </item>
  </channel>
</rss>
