<?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>Wed, 22 May 2013 11:13:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Till Klampaeckel's Blog: Zend Framework: CRUD]]></title>
      <guid>http://www.phpdeveloper.org/news/17988</guid>
      <link>http://www.phpdeveloper.org/news/17988</link>
      <description><![CDATA[<p>
In <a href="http://till.klampaeckel.de/blog/archives/183-Zend-Framework-CRUD.html">this new post</a> to his blog <i>Till Klampaeckel</i> shares a Zend Framework "base" controller that makes it easier to do the usual CRUD (Create, Read, Update, Delete) operations in an application.
</p>
<blockquote>
I think it took me (or us) a couple attempts to get this right - let me introduce you to Zf_Crud, a CRUD controller for the Zend Framework. [...] Zf_Crud aims to provide you with an interface for any table possible - think of it as a phpMyAdmin more tailored towards your data and (thanks to Twitter Bootstrap and the <a href="https://github.com/easybib/EasyBib_Form_Decorator">Easybib_Form_Decorator</a>) prettier!
</blockquote>
<p>
He <a href="http://till.klampaeckel.de/blog/archives/183-Zend-Framework-CRUD.html">shows how to install and use it</a> (via PEAR or Composer) and an example of a controller extending it. You can <a href="https://github.com/lagged/Zf_Crud/downloads">find the code here</a> on github, ready to clone and try out.
</p>]]></description>
      <pubDate>Tue, 22 May 2012 10:07:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Richard Miller's Blog: Symfony2: Moving Away From the Base Controller]]></title>
      <guid>http://www.phpdeveloper.org/news/16468</guid>
      <link>http://www.phpdeveloper.org/news/16468</link>
      <description><![CDATA[<p>
<i>Richard Miller</i> has a new post to his blog today that recommends <a href="http://miller.limethinking.co.uk/2011/06/14/symfony2-moving-away-from-the-base-controller/">moving away from the base controller</a> the Symfony introductory documentation has you make. He suggests an alternative that can be used more widely.
</p>
<blockquote>
In fact, it is the advised <a href="http://symfony.com/doc/2.0/book/bundles.html#controllers">best practice for controllers in shared bundles</a>. When you do, you will no longer have access to these useful methods, in this post I am going to look at how to accomplish the same tasks without them. I have created a simple controller for some basic form interaction with a model which uses the base controllers methods. I am going to go through how to change this to a service which does not extend the base controller.
</blockquote>
<p>
He starts with his "TestimonialController" that does some of the basic CRUD operations on the testimonial information. He shows you, step-by-step, the refactoring needed to stop using things like the default controller helpers (each with replacement code). With those removed, he can move to extend "ContainerAware" instead of "Controller", make the controller a service and doing some dependency injection for needed resources.
</p>]]></description>
      <pubDate>Tue, 14 Jun 2011 13:23:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: PHP Template Engine Comparison. Part 2 (vs Plain PHP)]]></title>
      <guid>http://www.phpdeveloper.org/news/15794</guid>
      <link>http://www.phpdeveloper.org/news/15794</link>
      <description><![CDATA[<p>
Following in the heels of his <a href="http://phpdeveloper.org/news/15748">first post</a> looking at a few of the templating offerings available to PHP applications, <i>Gonzalo Ayuso</i> is back with <a href="http://gonzalo123.wordpress.com/2011/01/24/php-template-engine-comparison-part-2-versus-plain-php/">part two</a> - a comparison versus just "plain PHP".
</p>
<blockquote>
In my <a href="http://gonzalo123.wordpress.com/2011/01/17/php-template-engine-comparison/">last</a> post I created a small (and very personal) test of different templating engines in PHP (Smarty, Haanga and Twiw). Someone posted a comment asking for the comparison between those template engines and old school phtml. OK I've done some tests. It's a bit difficult to create the template inheritance (without cloning one of the template engines and creating a new one) so I have one approximation with a simple include. It's not the same but it's similar.
</blockquote>
<p>
He tries to recreate a similar scenario as in the three other templating tools by setting up a base template (with inline PHP), a class to populate the contents of it and a sample template with "inheritance". He stacks up the execution times and memory usage against the results from the other three with interesting results, specifically compared to <a href="http://www.haanga.org">Haanga</a>.
</p>]]></description>
      <pubDate>Mon, 24 Jan 2011 11:11:07 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Phil Sturgeon's Blog: CodeIgniter Base Classes: Keeping it DRY]]></title>
      <guid>http://www.phpdeveloper.org/news/14009</guid>
      <link>http://www.phpdeveloper.org/news/14009</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Phil Sturgeon</i> looks at <a href="http://philsturgeon.co.uk/news/2010/02/CodeIgniter-Base-Classes-Keeping-it-DRY">creating sharable code</a> for your controllers in a <a href="http://codeigniter.com">CodeIgniter</a> application (DRY: Don't Repeat Yourself).
</p>
<blockquote>
The idea is that most of your controllers share something in common with each other. For example: All admin controllers need to make sure a logged in user is present and that they are an administrator. A public controller may want to load a theme for your application and load default user data, navigation links or anything else frontend related.
</blockquote>
<p>
The problem is solved by creating a base controller - in his example its one called MY_Controller that follows the CodeIgniter naming convention and allows you to easily make other controllers that extend it. You'll also need to make a small addition to your config.php file to get the base controllers working correctly and make them able to be found.
</p>]]></description>
      <pubDate>Thu, 11 Feb 2010 09:46:51 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ben Scholzen's Blog: Writing powerful and easy config files with PHP-arrays]]></title>
      <guid>http://www.phpdeveloper.org/news/12491</guid>
      <link>http://www.phpdeveloper.org/news/12491</link>
      <description><![CDATA[<p>
<i>Ben Scholzen</i> has <a href="http://www.dasprids.de/blog/2009/05/08/writing-powerful-and-easy-config-files-with-php-arrays">written up a post</a> about how regular PHP arrays can be used as a native configuration option for your applications.
</p>
<blockquote>
I was asked many times how I organize my config files, and my response was always the same, until some time ago when I switched began refactoring the codebase of my blog. [...] Looking at [the advantages of PHP config files], you may ask now why not everbody is using them. Well the problem mostly is that you cannot create extend-sections (when working with Zend_Config for example). 
</blockquote>
<p>
He compares an example of a method that, using a base config file with some "smarts", you can have it automatically pull in certain files and overwrite settings from the array inside. A sample "other config" file is also included, showing the definition of some PHP settings, resources and database information.
</p>]]></description>
      <pubDate>Mon, 11 May 2009 12:05:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jordi Boggiano's Blog: Multiton base class]]></title>
      <guid>http://www.phpdeveloper.org/news/11641</guid>
      <link>http://www.phpdeveloper.org/news/11641</link>
      <description><![CDATA[<p>
In <a href="http://seld.be/notes/multiton-base-class">this recent post</a> <i>Jordi Boggiano</i> looks at a different sort of design pattern - a sort of extension of the Singleton pattern: Multition.
</p>
<blockquote>
While I like the <a href="http://en.wikipedia.org/wiki/Singleton_pattern">Singleton</a> pattern every now and then, I prefer the flexibility that the <a href="http://en.wikipedia.org/wiki/Multiton">Multiton</a> potentially offers, and well it's just an extended version of the Singleton, so it's "compatible" with the Singleton model. Anyway, to the point, PHP5.3 is coming, and with Late Static Binding you can do a base Multiton (or Singleton if you insist), which wasn't possible before. Now I like this very much because you can simply extend it rather than rewriting those (few, I know, but still) lines each time. 
</blockquote>
<p>
Included in <a href="http://seld.be/notes/multiton-base-class">the post</a> is an example of the design pattern showing how to create its structure in the class and use it to grab the same or unique instances (defined with an ID).
</p>]]></description>
      <pubDate>Tue, 30 Dec 2008 11:17:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: Base classes in OOP programming languages]]></title>
      <guid>http://www.phpdeveloper.org/news/11429</guid>
      <link>http://www.phpdeveloper.org/news/11429</link>
      <description><![CDATA[<p>
<i>Jani Hartikainen</i> has followed up on a post from <i>David Otten</i> about standard classes in PHP and how they provide the base for much of what the language does.
</p>
<blockquote>
David Otton posted a <A href="http://www.otton.org/2008/11/11/php-base-class-stdclass/">short but thought-provoking post about stdClass</a>, which many think is the "base class" all PHP classes automatically inherit from. I have to admit that I had this misconception as well. [...] This [difference in PHP from other OOP languages] presents some room for analysis in how things are handled in dynamic and static languages, and how those differences affect things...
</blockquote>
<p>
<i>Jani</i> <a href="http://codeutopia.net/blog/2008/11/19/base-classes-in-oop-programming-languages/">talks about</a> dynamic and static typing in languages and how that effects the base types things are extended from as well as some of the benefits that having a standard base class affords developers.
</p>]]></description>
      <pubDate>Wed, 19 Nov 2008 16:10:58 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Richard Thomas' Blog: Using jQuery with Solar]]></title>
      <guid>http://www.phpdeveloper.org/news/11232</guid>
      <link>http://www.phpdeveloper.org/news/11232</link>
      <description><![CDATA[<p>
In a <a href="http://www.phpjack.com/content/using-jquery-solar">quick new entry</a> to his blog, <i>Richard Thomas</i> shows how to integrate the popular <a href="http://www.jquery.com">jQuery</a> javascript library into your <a href="http://www.solarphp.com">Solar</a> application.
</p>
<blockquote>
Going to go through a quick walk through of how to use a hacked together version of my old jquery library with solar. You can find the class source files <a href="http://www.phpjack.com/jackfiles/jsolar.tgz">here</a>.
</blockquote>
<p>
He sets up a callback in the Base controller (that all other controllers extend) for the jQuery calls so that any of the "child" controllers can just call "/controller/jquery" to make jQuery requests.
</p>]]></description>
      <pubDate>Fri, 17 Oct 2008 09:31:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Richard Thomas: Solar Gets Firephp Support & a Base Controller Tip]]></title>
      <guid>http://www.phpdeveloper.org/news/11213</guid>
      <link>http://www.phpdeveloper.org/news/11213</link>
      <description><![CDATA[<p>
<i>Richard Thomas</i> has two new <a href="http://www.solarphp.com">Solar</a> framework posts added to his PHPJack blog - one talking about the new Firephp support integrated into the framework (similar to other frameworks) and a tip he's come across so far in using the framework.
</p>
<p>
In talking about the <a href="http://www.phpjack.com/content/solar-framework-adds-firebug-support-thanks-firephp">Firephp support</a>:
</p>
<blockquote>
There has been a flurry of work around <A href="http://www.getfirebug.com/">Firebug</a> recently including announcements that <a href="http://framework.zend.com/">Zend Framework</a> and <A href="http://www.symfony-project.org/">Symfony</a> both now have Firebug logging support through the use of the <A href="http://www.firephp.org/">Firephp</a>. As of this weekend <a href="http://www.solarphp.com/">Solar</a> can be added to the list with its own support.
</blockquote>
<p>
A <a href="http://www.phpjack.com/content/solar-framework-adds-firebug-support-thanks-firephp">quick example</a> is included.
</p>
<p>
In the <a href="http://www.phpjack.com/content/solar-tips-1">second post</a> he looks at a simpler way to share information between all of your controllers without code duplication - adding it to the constructor of the Base controller your application is built on.
</p>]]></description>
      <pubDate>Wed, 15 Oct 2008 07:56:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jeremy Johnstone's Blog: Enums in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11147</guid>
      <link>http://www.phpdeveloper.org/news/11147</link>
      <description><![CDATA[<p>
In <a href="http://www.jeremyjohnstone.com/blog/archives/2008/10/05/enums-in-php/">this new post</a> <i>Jeremy Johnstone</i> looks at creating a class to add that's missing from the basic datatype set of the language - enums.
</p>
<blockquote>
I stumbled across a blog post on <a href="http://it.toolbox.com/blogs/macsploitation/enums-in-php-a-native-implementation-25228">how to implement Enums in PHP via userland code</a> written by Jonathan Hohle. I liked the concept he had, but the implementation was a bit unappealing because it used eval() among other more minor issues. You shouldn't need to generate Enums at runtime, so I took that as a challenge to find a way to do it at compile time, thus making the code much more efficient.
</blockquote>
<p>
His enums would support type hinting and would, ideally, be iterable. He gives the code he's worked up - a base class, another than extends it to make a basic enum structure and some handy changes to support comparisons. A few more changes (and a few other extended classes later) he has some pretty well functioning enums that can even bee iterated through.
</p>]]></description>
      <pubDate>Mon, 06 Oct 2008 07:56:08 -0500</pubDate>
    </item>
  </channel>
</rss>
