<?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, 20 Jun 2013 01:26:10 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen: Injecting configuration into a ZF2 controller]]></title>
      <guid>http://www.phpdeveloper.org/news/19524</guid>
      <link>http://www.phpdeveloper.org/news/19524</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has a a new post to his site today showing you how to <a href="http://akrabat.com/zend-framework-2/injecting-configuration-into-a-zf2-controller/">inject configuration information</a> into a Zend Framework 2 controller via an interface and some initializer settings in the module setup.
</p>
<blockquote>
One thing you may find yourself needing to do is access configuration information in a controller or service class. The easiest way to do this is to use the ServiceManger's initialiser feature. This allows you to write one piece of injection code that can be applied to multiple objects. It's easier to show this in action!
</blockquote>
<p>
He includes a sample configuration file (with a setting for "setting_1") and the interface you implement to structure the load request. He then shows how to hook this into the controller and the code needed for the module "getControllerConfig" (or "getServiceConfig" for use with services) to load in the file and set it to the correct object.
</p>
Link: http://akrabat.com/zend-framework-2/injecting-configuration-into-a-zf2-controller]]></description>
      <pubDate>Tue, 30 Apr 2013 09:11:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPWomen.org: Add values to a symfony form in between save() and serialization to the database]]></title>
      <guid>http://www.phpdeveloper.org/news/18560</guid>
      <link>http://www.phpdeveloper.org/news/18560</link>
      <description><![CDATA[<p>
<i>Kim Rowan</i> has recently posted <a href="http://www.phpwomen.org/wordpress/2012/10/04/add-values-to-a-symfony-form-in-between-save-and-serialization-to-the-database">this helpful hint</a> to the PHPWomen.org site concerning the addition of values between save/serialization in Symfony (1.4) forms.
</p>
<blockquote>
OK, I have a Comment model and I want to relate Comment objects to several other different model types.  So, I need to be able to persist Comment objects in my database that relate to the author of the comment and one of a handful of other tables, for example, a blog post or a licence record, etc. 
</blockquote>
<p>
She includes the contents of her "schema.yml" definition and the code to create and display a basic form. Inside of her "executeCreate", the form's submission is handled and a "processForm" method is called and the overridden "updateObject " is used to inject the new data (a user ID) into the submission.
</p>]]></description>
      <pubDate>Fri, 05 Oct 2012 08:55:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ibuildings techPortal: Create MVC: Meet the ViewModel Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/15368</guid>
      <link>http://www.phpdeveloper.org/news/15368</link>
      <description><![CDATA[<p>
On the Ibuildings techPortal, there's <a href="http://techportal.ibuildings.com/2010/11/02/creative-mvc-meet-the-viewmodel-pattern/">a new tutorial posted</a> from <i>Barney Hanlon</i> looking at a new method that developers can use in their applications to give MVC apps a better way to handle their presentation logic - ViewModel.
</p>
<blockquote>
This provides MVC applications a natural location for presentation logic and lazy functionality while maintaining the segregation between the layers of responsibility within the code. It allows designers access to data and methods they need, while hiding aspects that aren't needed at view level. [...] Indeed, pretty much any modern Web framework has an understanding of the important segregation of duties inherent within MVC. It is precisely this segregation that leads to a certain greyness around the all-important View, particularly on sites where multiple content items are displayed in different ways.
</blockquote>
<p>
The tutorial he includes shows how to set up a site with multiple articles per page that can be shown as either headlines or just title text. He talks about three ways to accomplish this - the usual injection of all data into the view and having it handle it there, injecting a model directly and extracting data from it and the ViewModel approach (a combination of the Decorator and Adapter design patterns).
</p>]]></description>
      <pubDate>Tue, 02 Nov 2010 10:19:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gareth Heyes' Blog: Exploiting PHP SELF]]></title>
      <guid>http://www.phpdeveloper.org/news/9413</guid>
      <link>http://www.phpdeveloper.org/news/9413</link>
      <description><![CDATA[<p>
<i>Gareth Heyes</i> has a <a href="http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/">new post</a> today talking about one of the vulnerable values in the $_SERVER superglobal - PHP_SELF.
</p>
<blockquote>
I thought it might be a good idea to gather a few test cases demonstrating the problem. Why PHP allows these URL's is beyond me and it wouldn't take much work to filter out these malicious URL's in the PHP code.
</blockquote>
<p>
He <a href="http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/">provides</a> four test cases to show how simple it is to abuse - one using a HTTP header, another pushing XSS through, the third mentions search pages and the fourth a direct code injection.
</p>
<p>
You can <a href="http://www.thespanner.co.uk/wp-content/uploads/2008/01/php_selfphp.zip">download the code here</a>.
</p>]]></description>
      <pubDate>Mon, 14 Jan 2008 07:54:00 -0600</pubDate>
    </item>
  </channel>
</rss>
