<?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>Mon, 21 May 2012 08:12:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17510</guid>
      <link>http://www.phpdeveloper.org/news/17510</link>
      <description><![CDATA[<p>
Following up on their <a href="http://phpdeveloper.org/news/17472">previous look</a> at the component architecture of the Yii framework, PHPMaster has posted <a href="http://phpmaster.com/yii-under-the-hood-2">this new tutorial</a> showing how the framework allows you to do some event-based programming.
</p>
<blockquote>
An application event is something that occurs which might be of interest to other bits of code. A standard event in most GUI applications would be a "click" event, but the sky's the limit and what events you define is really up to you. [...] The details can be provided by application-specific modules allowing you to keep individual requirements separate from your reusable code. Events allow you to attach a potentially unlimited amount of functionality without changing your core modules and components.
</blockquote>
<p>
In his example, he shows how to create an event handler that is triggered when the user registers on the site. This event (CEvent) is then registered with the system and is attached via a call in the controller's "init" method.
</p>]]></description>
      <pubDate>Tue, 07 Feb 2012 11:53:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sanisoft.com:  Attach & detach behaviors at run-time in CakePHP Models]]></title>
      <guid>http://www.phpdeveloper.org/news/8128</guid>
      <link>http://www.phpdeveloper.org/news/8128</link>
      <description><![CDATA[<p>
The guys over on Sanisoft.com dropped us a line today to let us know about <a href="http://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-run-time-in-cakephp-models/">a new entry on their blog</a> showing how to implement attach and detach behaviors in CakePHP models.
</p>
<blockquote>
Behaviors are one of the best things that have been added to CakePHP 1.2, they allow you to add functionality to your models in a very elegant and modular fashion. They also promote a lot of code reuse. Perhaps a real life example would illustrate it better.
</blockquote>
<p>
They <a href="http://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-run-time-in-cakephp-models/">show how</a> to create behaviors that can perform a save() call on an image with the backend code doing all the hard work. They create the two methods - dontActAs and nowActsAs - to make attaching and detaching simple.
</p>]]></description>
      <pubDate>Tue, 26 Jun 2007 12:38:00 -0500</pubDate>
    </item>
  </channel>
</rss>

