<?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 21:43:07 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Patterns for Flexible View Handling, Part 1 - Working with Composites]]></title>
      <guid>http://www.phpdeveloper.org/news/18421</guid>
      <link>http://www.phpdeveloper.org/news/18421</link>
      <description><![CDATA[<p>
PHPMaster.com has started up a new series today with <a href="http://phpmaster.com/flexible-view-manipulation-1/">the first part</a> of a set of tutorials looking at design patterns that can be used in the handling of your views to make them more effective and easier to maintain.
</p>
<blockquote>
To overcome your skepticism [of an easy to use, flexible view system], in this two-part tutorial I'll show you how to implement from scratch a couple of customizable view handling modules by sinking our teeth into the goodies of the Composite and Decorator patterns.
</blockquote>
<p>
He starts off by creating a foundation to work from - a basic View class that takes in data, allows for the setting of a template and combines it all together when "render()" is called. He then takes this example and applies the Composite pattern and creates interfaces for the template, container and view, implements them and shows how to attach views to other views. Each of these views is then rendered when the main "render()" method is called and the output is appended.
</p>]]></description>
      <pubDate>Thu, 30 Aug 2012 08:32:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ralph Schindler's Blog: Composite Rowsets For Many-To-Many Relationships Via Zend_Db_Table]]></title>
      <guid>http://www.phpdeveloper.org/news/15438</guid>
      <link>http://www.phpdeveloper.org/news/15438</link>
      <description><![CDATA[<i>Ralph Schindler</i> has <a href="http://ralphschindler.com/2010/11/15/composite-rowsets-for-many-to-many-relationships-via-zend_db_table">posted a handy tutorial</a> (along with some helpful code) to his blog today about handling many-to-many composite rowset  relationships with the Zend_Db component of the Zend Framework.
</p>
<blockquote>
One of the hardest problems to solve when developing an ORM of any complexity is in deciding how to handle the retrieval of rows that satisfy a <a href="http://en.wikipedia.org/wiki/Many-to-many_(data_model)">many-to-many relationship</a>, also known as a M:N relationship. [...] To model M:N relationships, database developers must get creative. By employing the use of a "3rd party", and by utilizing foreign keys that model a 1:N relationship, database developers can model a M:N relationship. 
</blockquote>
<p>
He looks at the Zend_Db_Table_Row class of the framework and how it works with these junction tables and how it has <a href="http://framework.zend.com/issues/browse/ZF-6232">an issue</a> where it returns the junction table columns too. A fix was released (in 1.10.2) for the framework to work correctly. Unfortunately, this also left those using the method out in the cold. So, <i>Ralph</i> has <a href="https://github.com/gooeylabs/Gooey-PHP-5.2-Components">created his own workaround</a> called a composite rowset. He includes an example snippet to give you an idea of how it works, but you can download the code from <a href="https://github.com/gooeylabs/Gooey-PHP-5.2-Components">his github repository</a> for a closer look.
</p>]]></description>
      <pubDate>Tue, 16 Nov 2010 11:08:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Zienert's Blog: Zend_Form Decorators and Composite Elements]]></title>
      <guid>http://www.phpdeveloper.org/news/14692</guid>
      <link>http://www.phpdeveloper.org/news/14692</link>
      <description><![CDATA[<p>
<i>Rob Zienert</i> has a new post to his blog today looking at <a href="http://robzienert.com/2010/06/22/zend_form-decorators-and-composite-elements/">Zend_Form decorators and composite elements</a> to make for more powerful forms in your Zend Framework application.
</p>
<blockquote>
Today had quite a number of Zend_Form-related questions in #zftalk. Everything from Decorators to Composite Elements, you know - the usual Zend_Form questions. What better way to answering questions than with a blog post and some sample code?
</blockquote>
<p>
His illustration of decorators shows how to put each of the form elements inside of a "DI" tag to help makes the lives of the frontend developers that much simpler. For the composite elements he shows how to use them to group a set of selects into one object that is then validated through Zend_Date for valid date information. You can grab the code for each of these illustrations from <a href="http://github.com/robzienert/ZFTutorials/tree/feature/form-decorators">this account</a> on Github
</p>]]></description>
      <pubDate>Wed, 23 Jun 2010 12:50:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: Writing Composite Zend_Form Elements]]></title>
      <guid>http://www.phpdeveloper.org/news/14183</guid>
      <link>http://www.phpdeveloper.org/news/14183</link>
      <description><![CDATA[<p>
A recent tutorial (screencast) has been posted to the ZendCasts.com site looking at creating <a href="http://www.zendcasts.com/writing-composite-zend_form-elements/2010/03/">custom Zend_Form elements</a> when you need something more than just the usual, simple elements.
</p>
<blockquote>
This video should help you build your own composite Zend_Form element. We'll be building a phone element. The phone element will have 3 textboxes, one for geographic location, area code and local code. In the following videos will add a custom cell phone validator and some ajax validation. 
</blockquote>
<p>
You can grab a <a href="http://zendcasts.googlecode.com/svn/trunk/zc49-composite-form-elements/zc49-composite-form-elements.zip">copy of the source</a> if you'd like to follow along or you can just <a href="http://code.google.com/p/zendcasts/source/browse/#svn/trunk/zc49-composite-form-elements">look around the repository</a> to find the source for this and other great lessons from the site.
</p>]]></description>
      <pubDate>Mon, 15 Mar 2010 11:33:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Creating composite elements]]></title>
      <guid>http://www.phpdeveloper.org/news/12336</guid>
      <link>http://www.phpdeveloper.org/news/12336</link>
      <description><![CDATA[<p>
Based on an example in a previous blog post (seen <a href="http://weierophinney.net/matthew/archives/215-Rendering-Zend_Form-decorators-individually.html">here</a>) <i>Matthew Weier O'Phinney</i> wanted to <a href="http://weierophinney.net/matthew/archives/217-Creating-composite-elements.html">clear a few things up</a> on the "date of birth" element he had mocked up in his Zend_Form example.
</p>
<blockquote>
In my <a href="http://weierophinney.net/matthew/archives/215-Rendering-Zend_Form-decorators-individually.html">last post on decorators</a>, I had an example that showed rendering a "date of birth" element [...]. This has prompted some questions about how this element might be represented as a Zend_Form_Element, as well as how a decorator might be written to encapsulate this logic. Fortunately, I'd already planned to tackle those very subjects for this post! 
</blockquote>
<p>
To be able to use the element in its current state the key lies in the setValue method. More correctly in the overriding of the setValue method. He includes an example class that is smart enough to use that custom form element. It has get and set methods for each of the date fields (month/day/year) and the set/getValue methods that can interact using them. He wraps this all up inside a form decorator and creates an instance of the Date element to help create and handle the properties it has.
</p>]]></description>
      <pubDate>Tue, 14 Apr 2009 10:25:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Eran Galperin's Blog: The Advancing PHP Developer Part 5: Design Patterns ]]></title>
      <guid>http://www.phpdeveloper.org/news/10595</guid>
      <link>http://www.phpdeveloper.org/news/10595</link>
      <description><![CDATA[<p>
As a part of his "Advancing PHP Developer" series, <i>Eran Galperin</i> has posted <a href="http://www.techfounder.net/2008/07/12/the-advancing-php-developer-part-5-design-patterns">part five</a>, a look at design patterns and what they can do for you and your application.
</p>
<blockquote>
A <a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)">design</a> pattern is a general reusable solution to a recurring design problem in object-oriented systems. Design patterns are essentially blueprints that suggest how to solve a particular set of OO design problems while adhering to OO best good-practices (which I've recounted in my <a href="http://www.techfounder.net/2008/05/25/the-advancing-php-developer-part-2-object-orientation/">Object Oriented part of this series</a>).
</blockquote>
<p>
He talks about one of the most popular examples - the Model/View/Controller design pattern that is used in many rapid development frameworks for PHP (including CodeIgniter and the Zend Framework). He also briefly mentions a few others like the <a href="http://en.wikipedia.org/wiki/Composite_pattern">composite</a>, <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton</a> and <a href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator</a> patterns.
</p>
<p>
Other parts of this series include looks at <a href="http://www.techfounder.net/2008/06/07/the-advancing-php-developer-part-4-testing/">testing</a>, <a href="http://www.techfounder.net/2008/05/27/the-advancing-php-developer-part-3-refactoring/">refactoring</a> and <a href="http://www.techfounder.net/2008/05/25/the-advancing-php-developer-part-1-coding-standards/">coding standards</a>.
</p>]]></description>
      <pubDate>Mon, 14 Jul 2008 09:32:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[P&aacute;draic Brady's Blog: Complex Views with the Zend Framework - Part 3: Composite View Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/7724</guid>
      <link>http://www.phpdeveloper.org/news/7724</link>
      <description><![CDATA[<p>
In his continuing look at using the composite design pattern inside the Zend Framework views (as helpers), <i>P&aacute;draic Brady</i> has posted <a href="http://blog.astrumfutura.com/archives/283-Complex-Views-with-the-Zend-Framework-Part-3-Composite-View-Pattern.html">part three</a> demonstrating the creation of complex views.
</p>
<blockquote>
In this post, I offer a brief explanation of the Composite View pattern. It's beyond its scope to show an implementation using the Zend Framework though that's what I'm building up to accomplish in a later blog entry.
</blockquote>
<p>
He <a href="http://blog.astrumfutura.com/archives/283-Complex-Views-with-the-Zend-Framework-Part-3-Composite-View-Pattern.html">goes through</a> what the design pattern is (including a UML diagram showing it's relations) and how it's commonly used. Following this, he shows a little bit of the code in action that includes the use of an attach() method to include the "child Views" at certain locations.
</p>]]></description>
      <pubDate>Fri, 27 Apr 2007 11:41:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[P&aacute;draic Brady's Blog: Complex Web Pages with the Zend Framework?]]></title>
      <guid>http://www.phpdeveloper.org/news/7662</guid>
      <link>http://www.phpdeveloper.org/news/7662</link>
      <description><![CDATA[<p>
In a <a href="http://blog.astrumfutura.com/archives/281-Complex-Web-Pages-with-the-Zend-Framework.html">new blog entry</a>, <i>P&aacute;draic Brady</i> (and fellow developers) start off their look at the Zend Framework. They begin with a foundation structure (Java BluePrints Pet Shop for J2EE's example) and work up from there to develop <a href="http://w3style.co.uk/devnet-projects/pet-store/trunk/">their own application</a>. Unfortunately, when they get to the Views of the app, things get a little tricky:
</p>
<blockquote>
Back on track, the main problem of a complex View, is that the current Controller is only aware of a subset of its own required Model (data) and the current View. So how do do you get the View to include extra sections - for example, details from Technorati for your blog - which are common to ALL pages?
</blockquote>
<p>
The <a href="http://framework.zend.com">framework's documentation</a. currently suggests the _forward() method to try to help, but it's just not the "right" way to do it. So, they take an alternative approach - going with a design pattern, the <a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/CompositeView.html">Composite View</a> and View Helper combination, to accomplish the "reusable page bits" they need.
</p>]]></description>
      <pubDate>Thu, 19 Apr 2007 14:50:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Working with Strings and the Composite Pattern in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/7431</guid>
      <link>http://www.phpdeveloper.org/news/7431</link>
      <description><![CDATA[<p>
DevShed has posted <a href="http://www.devshed.com/c/a/PHP/Working-with-Strings-and-the-Composite-Pattern-in-PHP-5/">the second and last part</a> of a series of two articles based around the Composite design pattern - using it to work with strings in PHP5.
</p>
<blockquote>
Are you a PHP developer who wants to improve your skills in pattern-based programming in PHP? If the answer to this question is a emphatic yes, then you should begin reading this article now! Welcome to the final part of the series "Implementing the composite pattern with PHP 5." Comprised of two instructive tutorials, this series walks you through the basic concepts of this important design pattern, and shows you how to apply it with some educational examples.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Working-with-Strings-and-the-Composite-Pattern-in-PHP-5/1/">start by defining</a> a simple StringProcessor class as an abstract interface to build from. From there, they create two other classes - the SingleStringProcessor and the MultipleStringProcessor. Each of these takes in either a single file or multiple filenames and spits back out the value of the string and the length of the string.
</p>]]></description>
      <pubDate>Wed, 14 Mar 2007 11:14:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Introducing the Composite Pattern in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/7413</guid>
      <link>http://www.phpdeveloper.org/news/7413</link>
      <description><![CDATA[<p>
Continuing their look at design patterns, DevShed has <a href="http://www.devshed.com/c/a/PHP/Introducing-the-Composite-Pattern-in-PHP-5/">kicked off</a> yet another series today spotlighting the Composite pattern as used in PHP5.
</p>
<blockquote>
The composite pattern is one of the less commonly used patterns in PHP 5. Nevertheless, in certain situations, it is very helpful. This article, the first one in a two-part series, will introduce you to the basic concepts of the composite pattern.
</blockquote>
<p>
The composite pattern allows you to define a single or multiple objects that will have identical behavior - basically behaving the same if there's just one or with the multiple instances. They <a href="http://www.devshed.com/c/a/PHP/Introducing-the-Composite-Pattern-in-PHP-5/1/">start with the basics</a>, reaching for one of their standard examples - a file information reader - to illustrate their point. They create the two helper classes it needs to work, one for the single file read and another for the multiple file read. The finish by combining them all together for a file-reading fiesta, showing how to get a one shot info dose as well adding files to the list and grabbing their info all together.
</p>]]></description>
      <pubDate>Fri, 09 Mar 2007 09:33:00 -0600</pubDate>
    </item>
  </channel>
</rss>
