<?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>Fri, 24 May 2013 19:59:05 -0500</pubDate>
    <ttl>30</ttl>
    <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>
