<?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>Tue, 21 May 2013 21:22:11 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[MaltBlue.com: Zend Framework 2 Forms - Simple and Available Everywhere]]></title>
      <guid>http://www.phpdeveloper.org/news/19411</guid>
      <link>http://www.phpdeveloper.org/news/19411</link>
      <description><![CDATA[<p>
<i>Matt Setter</i> has a new post to his site today about <a href="http://www.maltblue.com/zend-framework/simple-zend-framework-2-forms">forms in Zend Framework 2</a> including a full example on how to use them to create a form for user information (first name, last name).
</p>
<blockquote>
I think it goes without saying, forms are one of the central elements of any web-based application. They're used for everything from logging in, to searching content and managing information. Given that, they should be first-class citizens, able to be developed and reused with relative ease. [...] However, given the amount of options, configurability and flexibility required, this isn't always easy. [...] In today's post, I'm going to assume you have a basic understanding of how forms work now. [...] I'm going to show you how to create flexible, reusable forms in one module and by the power of the ServiceManager reuse them throughout your application. 
</blockquote>
<p>
He starts with the inclusion of a dependency needed for his example - the ZfcUser component (installed via Composer). He then moves on to the actual code for the form creating a reusable module, an entity class for the User and the Fieldset/Form classes for the contents of the form. He also includes the code for the controller action and the view that outputs the form itself and handles the repopulation automagically (and includes a CSRF token).
</p>
Link: http://www.maltblue.com/zend-framework/simple-zend-framework-2-forms]]></description>
      <pubDate>Thu, 04 Apr 2013 11:29:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: Thoughts on module directory structure]]></title>
      <guid>http://www.phpdeveloper.org/news/18991</guid>
      <link>http://www.phpdeveloper.org/news/18991</link>
      <description><![CDATA[<p>
<i>Rob Allen</i>, in his Zend Framework 2 development, has <a href="http://akrabat.com/zend-framework-2/thoughts-on-module-directory-structure/">come up with a list of suggestions</a> about the use of modules in your applications, mainly relating to the structure of the files inside of them.
</p>
<blockquote>
I've been working on a Zend Framework 2 module within a larger project that doesn't have that many PHP class files. Specifically, it has a controller, a mapper, an entity, a service and a form. As a result, the traditional Zend Framework 2 directory structure for the Account module looks [overly complicated]. That's a lot of directories for not many files! As a result, I decided to flatten it to [something simpler].
</blockquote>
<p>
He includes both the "before" and "after" directory structures and continues on with two more suggestions - the removal of the top level "Account" folder inside of "src/" and, finally, removing "src/" all together with a slight modification to the autoloading. With a simpler module, though, something like this might make it easier to maintain and "follow" later down the road.
</p>]]></description>
      <pubDate>Fri, 04 Jan 2013 09:09:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[MaltBlue.com: Zend Framework 2 Modules - The Application's Heart]]></title>
      <guid>http://www.phpdeveloper.org/news/18979</guid>
      <link>http://www.phpdeveloper.org/news/18979</link>
      <description><![CDATA[<p>
<i>Matthew Setter</i> has a new post to his site today <a href="http://www.maltblue.com/tutorial/zend-framework-2-modules-the-applications-heart">introducing you to modules</a> in Zend Framework v2 - the "application's heart".
</p>
<blockquote>
So it really is rewarding and exciting to begin covering all that it has to offer us. In <a href="http://www.maltblue.com/articles-2/zend-framework-2-core-concepts-understanding-dependency-injection">part one of this series</a>, I looked at a central concept of the revised framework - Dependency Injection. In this, the second part, I'm moving on to give a good introduction to the next most important aspect - Modules. In today's post, we'll be looking at what they are, some thoughts and quotes from the key developers involved and working code to get you started.
</blockquote>
<p>
He talks about some of the key parts of modules in ZF2 (autoloader, manager and listeners) and includes links to a few examples. He then walks you through the creation of a simple module, scaffolding out the basics of the config and autoload handling. He leaves the rest up to you though including adding in the controller/model/views for the module and unit test or language support. 
</p>]]></description>
      <pubDate>Wed, 02 Jan 2013 09:16:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Living Apart Together: Decoupling Code and Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/18818</guid>
      <link>http://www.phpdeveloper.org/news/18818</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new post (by <i>Remi Woler</i>) that looks at abstraction and <a href="http://phpmaster.com/living-apart-together-decoupling-code-and-framework/">keeping functionality out of the framework</a> and more decoupled in case the need for switching environments/frameworks comes up.
</p>
<blockquote>
Of course you develop using the latest technologies and frameworks. You've written <a href="http://www.brandonsavage.net/why-every-developer-should-write-their-own-framework/">2.5 frameworks yourself</a>, your code is <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md">PSR-2 compliant</a>, fully unit-tested, has an accompanying <a href="http://phpmd.org/">PHPMD</a> and <a href="http://pear.php.net/package/PHP_CodeSniffer">PHPCS</a> config, and may even ship with proper documentation (really, that exists!). When a new version of your favorite framework is released, you've already used it in your own toy project and submitted a couple of bug reports, maybe even accompanied with a unit test to prove the bug and a patch that fixes it. If that describes you, or at least the developer you want to be: reconsider the relationship your code has with the framework.
</blockquote>
<p>
He talks some about the dependencies most code written today has on the frameworks it lives in and how a good project design can make it easier to decouple this relationship. He suggests using things like wrapper classes (think "services") to abstract out the functionality to custom components. It's these components that handle the work, just reporting back the results to the controller/model that called them.
</p>]]></description>
      <pubDate>Thu, 29 Nov 2012 09:32:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: Integrating BjyAuthorize with ZendNavigation]]></title>
      <guid>http://www.phpdeveloper.org/news/18777</guid>
      <link>http://www.phpdeveloper.org/news/18777</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has <a href="http://akrabat.com/zend-framework-2/integrating-bjyauthorize-with-zendnavigation/">posted a technique</a> for integrating the <a href="https://github.com/bjyoungblood/BjyAuthorize">BjyAuthorize</a>, a helpful module for access control in your Zend Framework 2 application, with the ZendNavigation module for user permissions-based navigation updates.
</p>
<blockquote>
If you are using <a href="https://github.com/bjyoungblood/BjyAuthorize">BjyAuthorize</a> for ACL configuration and want to use ZendNavigation's ZendAcl integration features, then you need to set the Acl and Role information into ZendNavigation.
</blockquote>
<p>
He includes the code you'll need to add to both the bootstrap of your application and the configuration to set up the "rule_providers" and "resource_providers". Then you can update your navigation settings to include "resource" and "rule" options to define with options a user can see.
</p>]]></description>
      <pubDate>Tue, 20 Nov 2012 13:57:09 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Martin Shwalbe: Getting Started with REST and Zend Framework 2]]></title>
      <guid>http://www.phpdeveloper.org/news/18736</guid>
      <link>http://www.phpdeveloper.org/news/18736</link>
      <description><![CDATA[<p>
<i>Martin Shwalbe</i> has a new post that wants to help you get started using the Zend Framework 2 for <a href="http://hounddog.github.com/blog/getting-started-with-rest-and-zend-framework-2/">creating REST web services</a> quickly and easily.
</p>
<blockquote>
Today i want to show you how to build a rest application. This tutorials assume you have completed the <a href="http://zf2.readthedocs.org/en/latest/user-guide/overview.html">Getting Started</a>. I will be repeating lot of the steps allready explained in there. There is also a sample Album module which you can install from <a href="https://github.com/Hounddog/Album">here</a>.
</blockquote>
<p>
He starts off by setting up the Album module to load via the module autoloader and sets up its controllers and views in the module configuration. He shows how set up the REST routes (via the "router" in the module config), how to set up the view strategy and how to make a first controller. There's also a bit about testing this newly setup module with PHPUnit.
</p>]]></description>
      <pubDate>Tue, 13 Nov 2012 09:57:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: ZendServiceManager configuration keys]]></title>
      <guid>http://www.phpdeveloper.org/news/18730</guid>
      <link>http://www.phpdeveloper.org/news/18730</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has a new post to his site sharing some examples of the <a href="http://akrabat.com/zend-framework-2/zendservicemanager-configuration-keys/">configuration possibilities</a> for the ZendServiceManager module of the Zend Framework 2.
</p>
<blockquote>
ZendServiceManager is usually configured in two places: an array in a config file or a method within your Module class. In either case, you provide a nested array of configuration information. [...] Within the service_manager array, there are a set of nested arrays which are generally used to configure how you want a given class to be instantiated. the names of these sub-arrays are hardcoded, so you just need to learn their names and the difference between them.
</blockquote>
<p>
He lists out each of the options and includes a brief example and description for each. Values include "invokables", "aliases" and "initializers". He also touches on controllers, view helpers and controller plugins and how they hook into the ServiceManager.
</p>]]></description>
      <pubDate>Mon, 12 Nov 2012 11:09:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: Module specific layouts in ZF2]]></title>
      <guid>http://www.phpdeveloper.org/news/18482</guid>
      <link>http://www.phpdeveloper.org/news/18482</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has <a href="http://akrabat.com/zend-framework-2/module-specific-layouts-in-zf2/">a new post</a> to his site about module-specific layouts in Zend Framework 2 via <a href="https://github.com/EvanDotPro/EdpModuleLayouts">a module</a> from <i>Evan Coury</i>.
</p>
<blockquote>
If you need different layout scripts to be rendered for different modules in Zend Framework 2, then Evan Coury has made this extremely easy. His new module <a href="https://github.com/EvanDotPro/EdpModuleLayouts">EdpModuleLayouts</a> is just the ticket! Once installed, you simply have to add a new array to a config file in the config/autoload folder.
</blockquote>
<p>
The update is just a simple "module_layouts" setting that lets you specify it based on the module name by giving it a layout path, He explains the script a bit more in the comments and points to <a href="http://blog.evan.pro/module-specific-layouts-in-zend-framework-2">this other post</a> for more information about modules handling their own layouts.
</p>]]></description>
      <pubDate>Mon, 17 Sep 2012 10:04:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Nikita Popov: Are PHP developers functophobic?]]></title>
      <guid>http://www.phpdeveloper.org/news/18352</guid>
      <link>http://www.phpdeveloper.org/news/18352</link>
      <description><![CDATA[<p>
In his most recent post <i>Nikita Popov</i> asks if <a href="http://nikic.github.com/2012/08/10/Are-PHP-developers-functophobic.html">PHP developers are functophobic</a> - that, in some of his experience, they don't like to use functions.
</p>
<blockquote>
Now, that was overly general, so let me clarify: PHP developers who have reached a certain degree of sophistication basically stop using plain functions - instead everything goes all classes and methods. At least that's the observation I made when looking at various open-source libraries and frameworks. The only type of function you'll find in any of the "high-quality" libs are anonymous functions. But that's pretty much it.
</blockquote>
<p>
He shares concern that this "anti-function" approach can cause some bad practices to come up, specifically when developers try to force things into OOP that don't need to be there. He suggests that "helper functions" are a perfect example of individual functions that might not need to go in a class. He notes that, unlike in other languages (like Python), PHP development tends to follow the "one class, one file" route. He wonders if a shift from this method and more to a "module" approach (a more "compact" method) could be a good thing.
</p>]]></description>
      <pubDate>Mon, 13 Aug 2012 12:58:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jurian Suilman's Blog: Use 3rd party modules in Zend Framework 2]]></title>
      <guid>http://www.phpdeveloper.org/news/18131</guid>
      <link>http://www.phpdeveloper.org/news/18131</link>
      <description><![CDATA[<p>
<i>Jurian Sluiman</i> has <a href="http://juriansluiman.nl/en/article/117/use-3rd-party-modules-in-zend-framework-2">posted this guide</a> to using other (3rd party) modules in your Zend Framework 2 applications with a few simple steps (code examples included).
</p>
<blockquote>
The release of the first RC (release candidate) of Zend Framework 2 is getting close. One last beta (beta5) and then the RC will be announced! With the current pace of modules spawning on GitHub, I think it is a good idea to give some insights in how you can use 3rd party modules. In this blog post I will focus on MVC modules: modules with routes pointing to controllers and view scripts for rendering. Because using a 3rd party MVC module does not mean you are enforced to follow their routing scheme, use their view scripts or use the predefined forms, I will explain how you can modify those options to your needs. 
</blockquote>
<p>
He covers the three steps needed for integration - adding a new route to handle the requests to the module, adding a view script to handle its output and working with a Form instance to add a bit more handling. 
</p>]]></description>
      <pubDate>Mon, 25 Jun 2012 09:49:42 -0500</pubDate>
    </item>
  </channel>
</rss>
