<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>RosSoft</title>
	<atom:link href="http://rossoft.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rossoft.wordpress.com</link>
	<description>CakePHP Tips &#38; Tricks</description>
	<pubDate>Thu, 07 Sep 2006 17:52:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language></language>
			<item>
		<title>AJAX Star Rating helper</title>
		<link>http://rossoft.wordpress.com/2006/09/07/ajax-star-rating-helper/</link>
		<comments>http://rossoft.wordpress.com/2006/09/07/ajax-star-rating-helper/#comments</comments>
		<pubDate>Thu, 07 Sep 2006 17:52:35 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/09/07/ajax-star-rating-helper/</guid>
		<description><![CDATA[An AJAX Star Rating Helper based on link1 and link2.
Installation instructions.1) Download + install CJS Templates version 2.1 from cakeforge snippets2) Copy star CSS file to app/webroot/css/star_rating/star_rating.css&#160; and add the line &#8220;overflow: hidden;&#8221; to .star-rating3) Copy star Image file to app/webroot/css/star_rating/alt_star.gif4) Copy the helper to app/views/helpers/star_rating.php
Usage example: include the helper and in your view file:
echo [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>An AJAX Star Rating Helper based on <a href="http://www.naffis.com/blog/articles/2006/08/31/rails-ajax-star-rating-system">link1</a> and <a href="http://komodomedia.com/blog/samples/star_rating/example2.htm">link2.</a></p>
<p>Installation instructions.<br />1) Download + install CJS Templates version 2.1 from cakeforge snippets<br />2) Copy<a href="http://komodomedia.com/blog/samples/star_rating/example2.htm"> star CSS file</a> to app/webroot/css/star_rating/star_rating.css<br />&nbsp; and add the line &#8220;overflow: hidden;&#8221; to .star-rating<br />3) Copy <a href="http://komodomedia.com//blog/samples/star_rating/alt_star.gif">star Image file</a> to app/webroot/css/star_rating/alt_star.gif<br />4) Copy the helper to app/views/helpers/star_rating.php</p>
<p>Usage example: include the helper and in your view file:</p>
<p>echo $starRating-&gt;display(&#8217;Post/rating&#8217;,&#8221;/posts/rate/$id&#8221;)</p>
<p>It will create a star rater for the field Post/rating. An AJAX call will be made to /posts/rate/$id/$rate_value ( /$rate_value is appended to the CakeUrl that you pass to display function )</p>
<p>&lt;?php<br />/**<br />&nbsp;* Star Rating Helper<br />&nbsp;*<br />&nbsp;* @author RosSoft<br />&nbsp;* @version 0.1<br />&nbsp;* @license MIT<br />&nbsp;*<br />&nbsp;* @link http://www.naffis.com/blog/articles/2006/08/31/rails-ajax-star-rating-system<br />&nbsp;*<br />&nbsp;* Copy star CSS file to app/webroot/css/star_rating/star_rating.css<br />&nbsp;* and add the line &#8220;overflow: hidden;&#8221; to .star-rating<br />&nbsp;*<br />&nbsp;* @link http://komodomedia.com/blog/samples/star_rating/example2.htm<br />&nbsp;*<br />&nbsp;*<br />&nbsp;*<br />&nbsp;* Copy star Image file to app/webroot/css/star_rating/alt_star.gif<br />&nbsp;* http://komodomedia.com//blog/samples/star_rating/alt_star.gif<br />&nbsp;*<br />&nbsp;* @package helpers<br />&nbsp;*<br />&nbsp;* Usage example: include the helper and in your view file:<br />&nbsp;* echo $starRating-&gt;display(&#8217;Post/rating&#8217;,&#8221;/posts/rate/$id&#8221;)<br />&nbsp;* It will create a star rater for the field Post/rating. An AJAX call<br />&nbsp;* will be made to /posts/rate/$id/$rate_value<br />&nbsp;* ( /$rate_value is appended to the CakeUrl that you pass to display function )<br />&nbsp;*/</p>
<p>class StarRatingHelper extends Helper<br />{<br />&nbsp;&nbsp; &nbsp;var $helpers=array(&#8217;Head&#8217;,'Util&#8217;,'Page&#8217;);</p>
<p>&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * Pixels of star width<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;var $_star_width=25;</p>
<p>&nbsp;&nbsp; &nbsp;var $ratings=array(<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(&nbsp;&nbsp; &nbsp;&#8217;title&#8217;=&gt;&#8217;1 estrella de 5&#8242;,<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&#8217;class&#8217;=&gt;&#8217;one-star&#8217;),</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(&nbsp;&nbsp; &nbsp;&#8217;title&#8217;=&gt;&#8217;2 estrellas de 5&#8242;,<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&#8217;class&#8217;=&gt;&#8217;two-stars&#8217;),</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(&nbsp;&nbsp; &nbsp;&#8217;title&#8217;=&gt;&#8217;3 estrellas de 5&#8242;,<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&#8217;class&#8217;=&gt;&#8217;three-stars&#8217;),</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(&nbsp;&nbsp; &nbsp;&#8217;title&#8217;=&gt;&#8217;4 estrellas de 5&#8242;,<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&#8217;class&#8217;=&gt;&#8217;four-stars&#8217;),</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(&nbsp;&nbsp; &nbsp;&#8217;title&#8217;=&gt;&#8217;5 estrellas de 5&#8242;,<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&#8217;class&#8217;=&gt;&#8217;five-stars&#8217;)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;);</p>
<p>&nbsp;&nbsp; &nbsp;function _width($score)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if ($score &gt;=0 &amp;&amp; $score &lt;=5)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$width = $score * $this-&gt;_star_width;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$width=0;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return $width;<br />&nbsp;&nbsp; &nbsp;}</p>
<p>&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * Creates a star rater.<br />&nbsp;&nbsp; &nbsp; * @param mixed $value Model/field of the actual rate or the rate in float [0..5]<br />&nbsp;&nbsp; &nbsp; * &nbsp;&nbsp; &nbsp;Examples:<br />&nbsp;&nbsp; &nbsp; *&nbsp;&nbsp; 3.5<br />&nbsp;&nbsp; &nbsp; *&nbsp;&nbsp; Post/rate<br />&nbsp;&nbsp; &nbsp; * @url Url to be called through AJAX<br />&nbsp;&nbsp; &nbsp; *&nbsp; Example: if you need to rate the post id 3<br />&nbsp;&nbsp; &nbsp; *&nbsp;&nbsp;&nbsp;&nbsp; $url=&#8217;/post/rate/3&#8242;<br />&nbsp;&nbsp; &nbsp; *&nbsp; Then when clicked the 5 stars, the url called will be /post/rate/3/5<br />&nbsp;&nbsp; &nbsp; * @return string The html code for the star rater<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;function display($value,$url)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;static $index=0;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$index++;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$this-&gt;Head-&gt;css(&#8217;star_rating/star_rating&#8217;);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (!is_numeric($value))<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$score=$this-&gt;Util-&gt;retrieve_value($value);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$id=$this-&gt;Util-&gt;fieldname_to_formid($value);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$score=$value;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$id=&#8221;star_$index&#8221;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$width=$this-&gt;_width($score);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ob_start();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;?&gt;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;ul class=&#8217;star-rating&#8217; id=&#8217;&lt;?php echo $id?&gt;&#8217;&gt;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;li class=&#8217;current-rating&#8217; style=&#8217;width:&lt;?php echo $width?&gt;px;&#8217;&gt;&lt;/li&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;?php for ($i=0;$i&lt;5;$i++):?&gt;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;li&gt;&lt;a href=&#8217;#&#8217; onclick=&#8221;return false;&#8221; title=&#8217;&lt;?php echo $this-&gt;ratings[$i]['title']?&gt;&#8217; class=&#8217;star &lt;?php echo $this-&gt;ratings[$i]['class']?&gt;&#8217;&gt;&lt;?php echo($i+1)?&gt;&lt;/a&gt;&lt;/li&gt;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;?php echo $this-&gt;Page-&gt;event(&#8221;#$id .{$this-&gt;ratings[$i]['class']}&#8221;,&#8217;click&#8217;,$this-&gt;Page-&gt;remote_url($url . &#8216;/&#8217; . ($i+1),array(),false))?&gt;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;?php endfor;?&gt;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/ul&gt;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;?php<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return ob_get_clean();<br />&nbsp;&nbsp; &nbsp;}</p>
<p>&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * Change the number of stars of a displayed star rater<br />&nbsp;&nbsp; &nbsp; * @param string $dom_id The DOM ID of the star rater to change<br />&nbsp;&nbsp; &nbsp; * @param float $score The score from 0 to 5<br />&nbsp;&nbsp; &nbsp; *<br />&nbsp;&nbsp; &nbsp; * @return string HTML-Javascript Code<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;function change($dom_id,$score)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$width=$this-&gt;_width($score);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$css=&#8221;#{$dom_id} .current-rating&#8221;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$js=&#8221;_elem.style.width=&#8217;{$width}px&#8217;;&#8221;;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return $this-&gt;Page-&gt;for_each($css,$js);<br />&nbsp;&nbsp; &nbsp;}</p>
<p>&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp; &nbsp; * Creates an effect of highlight in a displayed star rater<br />&nbsp;&nbsp; &nbsp; * @param string $dom_id The DOM ID of the star rater to change<br />&nbsp;&nbsp; &nbsp; * @param float $duration Duration of the effect in seconds<br />&nbsp;&nbsp; &nbsp; *<br />&nbsp;&nbsp; &nbsp; * @return string HTML-Javascript Code<br />&nbsp;&nbsp; &nbsp; */<br />&nbsp;&nbsp; &nbsp;function highlight($dom_id,$duration=0.3)<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return $this-&gt;Page-&gt;effect(<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(&nbsp;&nbsp; &nbsp;&#8221;#$dom_id .current-rating&#8221;,<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&#8221;#$dom_id&#8221;)<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;,&#8217;Highlight&#8217;,array(&#8217;duration&#8217;=&gt;$duration));<br />&nbsp;&nbsp; &nbsp;}</p>
<p>}<br />?&gt;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/94/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/94/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=94&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/09/07/ajax-star-rating-helper/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Optimizing your queries</title>
		<link>http://rossoft.wordpress.com/2006/08/31/optimizing-your-queries/</link>
		<comments>http://rossoft.wordpress.com/2006/08/31/optimizing-your-queries/#comments</comments>
		<pubDate>Thu, 31 Aug 2006 10:18:25 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/08/31/optimizing-your-queries/</guid>
		<description><![CDATA[I&#8217;m working on a project with CakePHP &#38; MySQL 5, but it needs to beDBMS independant. I don&#8217;t like putting raw queries with Model-&#62;query.Some complex queries require some mysql custom functions. Most of that functions are available in all the common DBMS, but have a different syntax.For that purposes I use Mysql 5 Views. CakePHP [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m working on a project with CakePHP &amp; MySQL 5, but it needs to be<br />DBMS independant. I don&#8217;t like putting raw queries with Model-&gt;query.<br />Some complex queries require some mysql custom functions. Most of that functions are available in all the common DBMS, but have a different syntax.<br />For that purposes I use Mysql 5 Views. CakePHP hasn&#8217;t support for them yet, but <a href="https://trac.cakephp.org/ticket/1307">I&#8217;ve reported a ticket for fixing it.</a><br />Mysql Views with CakePHP are very powerful.<br />You can create a view that links several tables with complex &#8216;not exists&#8217; where clausules, then rename all the tables &#8216;id&#8217; fields to model_id. Now you can use standard CakePHP belongsTo relations to retrieve the other fields that you need.<br />With this way you can create very complex queries with minimum overhead.<br />For maximum performance, you must create indexes. For seeing where you need them, use the query &#8216;EXPLAIN SELECT &#8230;.&#8217;.<br />It will return several rows, with a lot of info for each operation that the DBMS must do for retrieve your query. In the column &#8216;type&#8217; it says how addresses the data. If it shows the &#8216;all&#8217; type, then that&#8217;s the worst system. If you see lots of them, create indexes in the fields that you use in your where clausules and execute again the &#8216;explain&#8217; statement for seeing if there&#8217;re improvement.<br />With some indexes and good views, you can have the most complex queries with good performance and DBMS independence.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/93/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/93/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=93&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/08/31/optimizing-your-queries/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MySecurity Component</title>
		<link>http://rossoft.wordpress.com/2006/08/23/mysecurity-component/</link>
		<comments>http://rossoft.wordpress.com/2006/08/23/mysecurity-component/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 13:08:51 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/08/23/mysecurity-component/</guid>
		<description><![CDATA[Some tricks for extra security in cake.
If you call http://example.com/users/render/delete (you&#8217;ve an UsersController) you will get rendered the delete.thtml view. Try it at home with any controller. The render() method from Controller gets called. I&#8217;m not sure if something dangerous can be done, but some other functions can be called like redirect. For forbidding all [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Some tricks for extra security in cake.</p>
<p>If you call http://example.com/users/render/delete (you&#8217;ve an UsersController) you will get rendered the delete.thtml view. <br />Try it at home with any controller. <br />The render() method from Controller gets called. I&#8217;m not sure if something dangerous can be done, but some other functions can be called like redirect. For forbidding all the methods from Controller base class, use this component.</p>
<p>&lt;?php<br />/**<br />&nbsp;* MySecurity.php<br />&nbsp;* Some security things for Cake<br />&nbsp;*<br />&nbsp;* Features:<br />&nbsp;* - The public functions from controller &amp; object now can&#8217;t be called from url<br />&nbsp;* -<br />&nbsp;*<br />&nbsp;* @author RosSoft<br />&nbsp;* @version 0.1<br />&nbsp;* @license MIT<br />&nbsp;*<br />&nbsp;* @package components<br />&nbsp;*/</p>
<p>class MySecurityComponent extends Object<br />{<br />&nbsp;&nbsp;&nbsp; var $components=array(&#8217;Security&#8217;);</p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* Extra forbidden actions<br />&nbsp;&nbsp;&nbsp; &nbsp;*<br />&nbsp;&nbsp;&nbsp; &nbsp;* @var array $forbidden_actions<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; var $forbidden_actions=array();</p>
<p>&nbsp;&nbsp;&nbsp; function startup(&amp;$controller)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;forbidden_actions=am($this-&gt;forbidden_actions, get_class_methods(&#8217;Controller&#8217;));</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;Security-&gt;startup($controller);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (in_array($controller-&gt;action,$this-&gt;forbidden_actions))<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;Security-&gt;blackHoleCallback=null;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;Security-&gt;blackHole($this);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}<br />?&gt;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/92/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/92/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=92&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/08/23/mysecurity-component/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Log messages to SQL debug window</title>
		<link>http://rossoft.wordpress.com/2006/08/23/log-messages-to-sql-debug-window/</link>
		<comments>http://rossoft.wordpress.com/2006/08/23/log-messages-to-sql-debug-window/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 12:53:12 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/08/23/log-messages-to-sql-debug-window/</guid>
		<description><![CDATA[My models have custom methods that do a lot of findAll(), save() etc. because I want to encapsulate that login on the models. Then the controller calls some of them in one action.
Sometimes, the SQL debug window has a lot of queries, and I don&#8217;t know what queries belongs to some method. 
Now, I can [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My models have custom methods that do a lot of findAll(), save() etc. because I want to encapsulate that login on the models. Then the controller calls some of them in one action.</p>
<p>Sometimes, the SQL debug window has a lot of queries, and I don&#8217;t know what queries belongs to some method. </p>
<p>Now, I can do<br />$this-&gt;MyModel-&gt;_log_info(&#8217;test begin&#8217;);<br />$this-&gt;MyModel-&gt;my_custom_method_that_does_a_lot_of_things();<br />$this-&gt;MyModel-&gt;_log_info(&#8217;end begin&#8217;);</p>
<p>And I see the text &#8216;test begin&#8217; and &#8216;end begin&#8217; inside the SQL Debug Window, and between there&#8217;s the queries that belongs to &#8216;my_custom_method&#8217;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* Logs the message to the sql debug window<br />&nbsp;&nbsp;&nbsp; &nbsp;*<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param string $msg Message to show <br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; function _log_info($msg)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (DEBUG)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $db =&amp; ConnectionManager::getDataSource($this-&gt;useDbConfig);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $db-&gt;error=&#8221;;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $db-&gt;affected=&#8221;;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $db-&gt;numRows=&#8221;;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $db-&gt;took=&#8221;;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $db-&gt;logQuery(&#8221;&lt;span class=\&#8221;query_log\&#8221;&gt;[{$this-&gt;name}] $msg&lt;/span&gt;&#8221;);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=91&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/08/23/log-messages-to-sql-debug-window/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Working with HABTM associations</title>
		<link>http://rossoft.wordpress.com/2006/08/23/working-with-habtm-associations/</link>
		<comments>http://rossoft.wordpress.com/2006/08/23/working-with-habtm-associations/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 12:46:37 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/08/23/working-with-habtm-associations/</guid>
		<description><![CDATA[I&#8217;ve done some functions for working with HABTM associations.For example:You&#8217;ve the model Post and the model Tag. Post HABTM Tag.You want to add the Tag with id 12 to the Post with id 3. Then you can do it easy with$this-&#62;Post-&#62;addAssoc(3,&#8217;Tag&#8217;,12);
Now you want to delete the association between the Post 3 and the Tag 15? [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve done some functions for working with HABTM associations.<br />For example:<br />You&#8217;ve the model Post and the model Tag. Post HABTM Tag.<br />You want to add the Tag with id 12 to the Post with id 3. Then you can do it easy with<br />$this-&gt;Post-&gt;addAssoc(3,&#8217;Tag&#8217;,12);</p>
<p>Now you want to delete the association between the Post 3 and the Tag 15? $this-&gt;Post-&gt;deleteAssoc(3,&#8217;Tag&#8217;,15);</p>
<p>You can even add more than one tag at once:<br />$this-&gt;Post-&gt;addAssoc(3,&#8217;Tag&#8217;,array(11,12));</p>
<p>Put these functions in your AppModel:<br />&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* Adds to a HABTM association some instances<br />&nbsp;&nbsp;&nbsp; &nbsp;*<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param integer $id The id of the record in this model<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param mixed $assoc_name The name of the HABTM association<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param mixed $assoc_id The associated id or an array of id&#8217;s to be added<br />&nbsp;&nbsp;&nbsp; &nbsp;* @return boolean Success<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; function addAssoc($id,$assoc_name,$assoc_id)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $data=$this-&gt;_auxAssoc($id,$assoc_name);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!is_array($assoc_id)) $assoc_id=array($assoc_id);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $data[$assoc_name][$assoc_name]=am($data[$assoc_name][$assoc_name],$assoc_id);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $this-&gt;save($data);<br />&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* Deletes from a HABTM association some instances<br />&nbsp;&nbsp;&nbsp; &nbsp;*<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param integer $id The id of the record in this model<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param mixed $assoc_name The name of the HABTM association<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param mixed $assoc_id The associated id or an array of id&#8217;s to be removed<br />&nbsp;&nbsp;&nbsp; &nbsp;* @return boolean Success<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; function deleteAssoc($id,$assoc_name,$assoc_id)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $data=$this-&gt;_auxAssoc($id,$assoc_name);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!is_array($assoc_id)) $assoc_id=array($assoc_id);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $result=array();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; foreach ($data[$assoc_name][$assoc_name] as $id)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!in_array($id, $assoc_id)) $result[]=$id;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $data[$assoc_name][$assoc_name]=$result;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $this-&gt;save($data);<br />&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* Returns the data associated with a HABTM in an array<br />&nbsp;&nbsp;&nbsp; &nbsp;* suitable for save without deleting the current relationships<br />&nbsp;&nbsp;&nbsp; &nbsp;*<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param integer $id The id of the record in this model<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param mixed $assoc_name The name of the HABTM association<br />&nbsp;&nbsp;&nbsp; &nbsp;* @return array Data array with current HABTM association intact<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; function _auxAssoc($id,$assoc_name)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //disable query cache<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $back_cache=$this-&gt;cacheQueries;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;cacheQueries=false;</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;recursive=1;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;unbindAll(array(&#8217;hasAndBelongsToMany&#8217;=&gt;array($assoc_name)));<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $data=$this-&gt;findById($id);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $assoc_data=array();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; foreach ($data[$assoc_name] as $assoc)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $assoc_data[]=$assoc['id'];<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; unset($data[$assoc_name]);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $data[$assoc_name][$assoc_name]=$assoc_data;</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //restore previous setting of query cache<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;cacheQueries=$back_cache;</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $data;<br />&nbsp;&nbsp;&nbsp; }</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/90/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/90/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=90&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/08/23/working-with-habtm-associations/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Updated packages in cakeforge</title>
		<link>http://rossoft.wordpress.com/2006/08/23/updated-packages-in-cakeforge/</link>
		<comments>http://rossoft.wordpress.com/2006/08/23/updated-packages-in-cakeforge/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 10:27:35 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/08/23/updated-packages-in-cakeforge/</guid>
		<description><![CDATA[Hi! I&#8217;ve been out because my internet connection at home was down  Now I return with some improvements in the HeadHelper and CJS Templates. They&#8217;re in cakeforge (CJS Templates version 2.1)
The syntax has changed a bit in HeadHelper (read the version changes) and don&#8217;t forget to read the installation instructions for CJS Templates.
  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi! I&#8217;ve been out because my internet connection at home was down <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> Now I return with some improvements in the <a href="http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/">HeadHelper</a> and <a href="http://rossoft.wordpress.com/2006/05/07/cajax-component-v2/">CJS Templates</a>. They&#8217;re in <a href="http://cakeforge.org/snippet/detail.php?type=packagever&amp;id=38">cakeforge (CJS Templates version 2.1)</a></p>
<p>The syntax has changed a bit in HeadHelper (read the version changes) and don&#8217;t forget to read the installation instructions for CJS Templates.<br /><a href="http://estatus_cake.rossoft.dsland.org/index.php/pages/contacto"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/89/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/89/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=89&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/08/23/updated-packages-in-cakeforge/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mail Templates</title>
		<link>http://rossoft.wordpress.com/2006/07/01/mail-templates/</link>
		<comments>http://rossoft.wordpress.com/2006/07/01/mail-templates/#comments</comments>
		<pubDate>Sat, 01 Jul 2006 09:40:57 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/07/01/mail-templates/</guid>
		<description><![CDATA[New template view for sending mail through SMTP
Example:- file app/views/foo/mail_view.mail &#160;&#160;&#160; &#160;&#160;&#160; &#60;m:from name=&#8221;Miguel Ros&#8221; mail=&#8221;fake@teleline.es&#8221; /&#62;&#160;&#160;&#160; &#160;&#160;&#160; &#60;m:to&#62;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; fake1@gmail.com&#160;&#160;&#160; &#160;&#160;&#160; &#60;/m:to&#62;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;m:to&#62;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; fake2@teleline.es&#160;&#160;&#160; &#160;&#160;&#160; &#60;/m:to&#62;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;m:subject&#62; Hi! That is the subject&#160;&#160;&#160; &#160;&#160;&#160; &#60;/m:subject&#62; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#60;m:body_text&#62;&#160;&#160;&#160; &#160;&#160;&#160; This is the plain body [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>New template view for sending mail through SMTP</p>
<p>Example:<br />- file app/views/foo/mail_view.mail <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:from name=&#8221;Miguel Ros&#8221; mail=&#8221;fake@teleline.es&#8221; /&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:to&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fake1@gmail.com<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:to&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:to&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fake2@teleline.es<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:to&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:subject&gt; Hi! That is the subject<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:subject&gt; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:body_text&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; This is the plain body text<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:body_text&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:body_html&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; This is the HTML &lt;b&gt;Body&lt;/b&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:body_html&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:attach path=&#8221;/tmp/test1.txt&#8221; name=&#8221;test_file_1.txt&#8221; /&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:attach path=&#8221;/tmp/test2.txt&#8221; /&gt; </p>
<p>- File views/foo/mail_view.thtml: <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The mail has been sent</p>
<p>&nbsp;<br />- Action in FooController:<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; function mail_view()<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;view=&#8217;Mail&#8217;;<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;render(); //render the mail_view.mail<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;view=&#8217;View&#8217;;<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;render(); //now the mail_view.thtml renders<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </p>
<p>Needs the <a href="http://rossoft.wordpress.com/2006/06/20/custom-html-tags-widgethelper/">WidgetHelper</a> and <a href="http://phpmailer.sourceforge.net/">PHPMailer class</a><br />Copy to app/views/mail.php</p>
<p>&lt;?php<br />/**<br />&nbsp;* Mail Templates<br />&nbsp;* Sends email through a view<br />&nbsp;*<br />&nbsp;* The templates rendered must have extension .mail<br />&nbsp;* <br />&nbsp;* Uses:<br />&nbsp;* @link http://phpmailer.sourceforge.net/ <br />&nbsp;* @see MailWidgetHelper<br />&nbsp;* <br />&nbsp;* @author RosSoft<br />&nbsp;* @version 0.1<br />&nbsp;* @license MIT<br />&nbsp;* <br />&nbsp;* <br />&nbsp;* Usage example:<br />&nbsp;* First, edit this file and change the define(&#8217;CONFIG_SMTP&#8230;<br />&nbsp;* with your ISP config. <br />&nbsp;*&nbsp;&nbsp; <br />&nbsp;* file views/foo/mail_view.mail <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:from name=&#8221;Miguel Ros&#8221; mail=&#8221;rosmiguel@teleline.es&#8221; /&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:to&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rossoft@gmail.com<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:to&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:to&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rosmiguel@teleline.es<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:to&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:subject&gt; Hi! That is the subject<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:subject&gt; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:body_text&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; This is the plain body text<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:body_text&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:body_html&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; This is the HTML &lt;b&gt;Body&lt;/b&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/m:body_html&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:attach path=&#8221;/tmp/test1.txt&#8221; name=&#8221;test_file_1.txt&#8221; /&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;m:attach path=&#8221;/tmp/test2.txt&#8221; /&gt; <br />&nbsp;&nbsp;&nbsp; File views/foo/mail_view.thtml: <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The mail has been set <br />&nbsp;&nbsp;&nbsp; Action in FooController:<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; function mail_view()<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;view=&#8217;Mail&#8217;;<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;render(); //render the mail_view.mail<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;view=&#8217;View&#8217;;<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;render(); //now the mail_view.thtml renders<br />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;<br />&nbsp;*/<br />&nbsp;<br />define(&#8217;CONFIG_SMTP_HOST&#8217;,'xxxx&#8217;);<br />define(&#8217;CONFIG_SMTP_USER&#8217;,'yyyy&#8217;);<br />define(&#8217;CONFIG_SMTP_PASS&#8217;,'zzzz&#8217;);</p>
<p>//Directory within VENDORS/<br />define(&#8217;PHPMAILER_SUBDIR&#8217;,'phpmailer&#8217; . DS);&nbsp;&nbsp;&nbsp; &nbsp;</p>
<p>class MailView extends View <br />{<br />&nbsp;&nbsp;&nbsp; var $mail=null; //instance of MailAux<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; function render($action = null, $layout = null, $file = null) <br />&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;mail=&amp; new MailAux;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;controller-&gt;mail=&amp; $this-&gt;mail;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $file=null;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $this-&gt;load_helper(&#8217;MailWidget&#8217;);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($action==NULL)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $action=$this-&gt;action;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $file=$this-&gt;get_filename($action,&#8217;.mail&#8217;);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ob_start();&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; parent::render($action,$layout,$file);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ob_get_clean();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $this-&gt;mail-&gt;send();&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; </p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* Adds a helper to the helpers array for loading it<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param string $helper Name of the helper like &#8216;Javascript&#8217;<br />&nbsp;&nbsp;&nbsp; &nbsp;*/&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; function load_helper($helper)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!in_array($helper,$this-&gt;helpers))<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;helpers[]=$helper;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* Returns the filename associated with the action<br />&nbsp;&nbsp;&nbsp; &nbsp;* with the extension &#8220;.$ext&#8221;<br />&nbsp;&nbsp;&nbsp; &nbsp;* <br />&nbsp;&nbsp;&nbsp; &nbsp;* @param string $action If null, then current action<br />&nbsp;&nbsp;&nbsp; &nbsp;* @param string $ext Extension of the view template (with dot) Example: &#8216;.xml&#8217;<br />&nbsp;&nbsp;&nbsp; &nbsp;* @return string<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; function get_filename($action,$ext)<br />&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $old_ext=$this-&gt;ext;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;ext=$ext;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $fn=$this-&gt;_getViewFileName($action);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;ext=$old_ext;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $fn;<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />}</p>
<p>/**<br />&nbsp;* This object is the interface between MailView and MailWidgetHelper<br />&nbsp;*/<br />class MailAux extends Object<br />{<br />&nbsp;&nbsp;&nbsp; var $charset=&#8217;utf-8&#8242;;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; var $from_mail=null;<br />&nbsp;&nbsp;&nbsp; var $from_name=&#8221;;<br />&nbsp;&nbsp;&nbsp; var $to=array();<br />&nbsp;&nbsp;&nbsp; var $subject=&#8221;;<br />&nbsp;&nbsp;&nbsp; var $body_text=null;<br />&nbsp;&nbsp;&nbsp; var $body_html=null;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; var $attachments=array();</p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* SMTP Configuration<br />&nbsp;&nbsp;&nbsp; &nbsp;*/&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; var $host=CONFIG_SMTP_HOST;<br />&nbsp;&nbsp;&nbsp; var $username=CONFIG_SMTP_USER;<br />&nbsp;&nbsp;&nbsp; var $password=CONFIG_SMTP_PASS;</p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* It contains mailer error message or false if no <br />&nbsp;&nbsp;&nbsp; &nbsp;* error has occurred<br />&nbsp;&nbsp;&nbsp; &nbsp;*/&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; var $error=false;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; function send()<br />&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vendor(PHPMAILER_SUBDIR. &#8216;class.phpmailer&#8217;);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail = new PHPMailer();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;PluginDir = VENDORS .PHPMAILER_SUBDIR ;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;SetLanguage(&#8217;en&#8217;,VENDORS .PHPMAILER_SUBDIR . &#8216;language&#8217; . DS);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;CharSet= $this-&gt;charset;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;IsSMTP();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // send via SMTP<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;Host&nbsp;&nbsp;&nbsp;&nbsp; = $this-&gt;host; // SMTP servers<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($this-&gt;username !==null)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;SMTPAuth = true;&nbsp;&nbsp;&nbsp;&nbsp; // turn on SMTP authentication<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;Username = $this-&gt;username;&nbsp; // SMTP username<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;Password = $this-&gt;password; // SMTP password&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;From = $this-&gt;from_mail;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;FromName = $this-&gt;from_name;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; foreach ($this-&gt;to as $address) <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;AddAddress($address);&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;Subject&nbsp; =&nbsp; $this-&gt;subject;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($this-&gt;body_html)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; { <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;IsHTML(true); // send as HTML&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;Body&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; $this-&gt;body_html;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;AltBody&nbsp; =&nbsp; $this-&gt;body_text;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;IsHtml(false);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;Body&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =&nbsp; $this-&gt;body_text;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //$mail-&gt;WordWrap = 50;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // set word wrap<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; foreach ($this-&gt;attachments as $attach)<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $mail-&gt;AddAttachment($attach['path'],$attach['name'],&#8217;base64&#8242;,$attach['type']);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (! $mail-&gt;Send())<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;error=$mail-&gt;ErrorInfo;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;log(&#8217;Mail send:&#8217; . $mail-&gt;ErrorInfo);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return false;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;error=false;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return true;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; }<br />}<br />?&gt;</p>
<p>Copy to app/views/helpers/mail_widget.php</p>
<p>&lt;?php<br />/**<br />&nbsp;* MailWidgetHelper<br />&nbsp;* <br />&nbsp;* For usage with MailView <br />&nbsp;*<br />&nbsp;* @author RosSoft<br />&nbsp;* @version 0.1<br />&nbsp;* @license MIT<br />&nbsp;*/<br />&nbsp; <br />class MailWidgetHelper extends WidgetHelper<br />{&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; var $tag=array(&nbsp;&nbsp;&nbsp; &#8216;m:from&#8217;,<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8216;m:to&#8217;,<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8216;m:subject&#8217;,<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8216;m:body_text&#8217;,<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8216;m:body_html&#8217;,<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8216;m:attach&#8217;);</p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* m:from (Mail From)<br />&nbsp;&nbsp;&nbsp; &nbsp;* $attr['mail'] Mail<br />&nbsp;&nbsp;&nbsp; &nbsp;* $attr['name'] Name (optional) <br />&nbsp;&nbsp;&nbsp; &nbsp;*/&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; function tag_m_from($attr,$inner_html)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;view-&gt;mail-&gt;from_name=@$attr['name'];<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;view-&gt;mail-&gt;from_mail=@$attr['mail'];<br />&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* m:to (Mail To)<br />&nbsp;&nbsp;&nbsp; &nbsp;* $inner_html Destination address<br />&nbsp;&nbsp;&nbsp; &nbsp;*/&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; function tag_m_to($attr,$inner_html)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;view-&gt;mail-&gt;to[]=$this-&gt;_trim($inner_html);<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* m:subject (Mail Subject)<br />&nbsp;&nbsp;&nbsp; &nbsp;* $inner_html The subject<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; function tag_m_subject($attr,$inner_html)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;view-&gt;mail-&gt;subject=$this-&gt;_trim($inner_html);<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* m:body_text&nbsp; Body in plain text<br />&nbsp;&nbsp;&nbsp; &nbsp;* $inner_html The body<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; &nbsp;function tag_m_body_text($attr,$inner_html)<br />&nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; $this-&gt;view-&gt;mail-&gt;body_text=$inner_html;<br />&nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* m:body_html Body in html text<br />&nbsp;&nbsp;&nbsp; &nbsp;* $inner_html The body<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; &nbsp;function tag_m_body_html($attr,$inner_html)<br />&nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; $this-&gt;view-&gt;mail-&gt;body_html=$inner_html;<br />&nbsp;&nbsp;&nbsp; &nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp; /**<br />&nbsp;&nbsp;&nbsp; &nbsp;* m:attach Adds an attachment<br />&nbsp;&nbsp;&nbsp; &nbsp;* $attr['path'] The path of the file<br />&nbsp;&nbsp;&nbsp; &nbsp;* $attr['name'] Overrides the attachment name<br />&nbsp;&nbsp;&nbsp; &nbsp;* $attr['type'] MIME type<br />&nbsp;&nbsp;&nbsp; &nbsp;*/<br />&nbsp;&nbsp;&nbsp; &nbsp;function tag_m_attach($attr,$inner_html)<br />&nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; $path=$attr['path'];<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; $name=($attr['name'])? $attr['name'] : &#8221;;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; $type=($attr['type'])? $attr['type'] : &#8216;application/octet-stream&#8217;;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; $this-&gt;view-&gt;mail-&gt;attachments[]=array(&nbsp;&nbsp;&nbsp; &#8216;path&#8217;=&gt;$path,<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8216;name&#8217;=&gt;$name,<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8216;type&#8217;=&gt;$type);<br />&nbsp;&nbsp;&nbsp; &nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;/**<br />&nbsp;&nbsp;&nbsp; &nbsp; * Removes the spaces, tabs, newlines from <br />&nbsp;&nbsp;&nbsp; &nbsp; * the beginning and ending of the string<br />&nbsp;&nbsp;&nbsp; &nbsp; * @param string $string<br />&nbsp;&nbsp;&nbsp; &nbsp; * @return string <br />&nbsp;&nbsp;&nbsp; &nbsp; */&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp; &nbsp;function _trim($string)<br />&nbsp;&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; preg_match(&#8217;/^[\n\t\s]*(.*)[\n\t\s]*$/&#8217;,$string,$matches);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; return $matches[1];&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;}</p>
<p>}<br />?&gt;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/88/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/88/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=88&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/07/01/mail-templates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Blog tutorial Chapter 3 done</title>
		<link>http://rossoft.wordpress.com/2006/06/24/blog-tutorial-chapter-3-done/</link>
		<comments>http://rossoft.wordpress.com/2006/06/24/blog-tutorial-chapter-3-done/#comments</comments>
		<pubDate>Sat, 24 Jun 2006 13:55:33 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/06/24/blog-tutorial-chapter-3-done/</guid>
		<description><![CDATA[Continuation of the extension blog tutorial.
Chapter 3: Ajax and Cookies. Saving a draft of the editing post in cookies through transparent periodicall ajax calls with feedback effects to the user.
Now you can get a .tgz file that containsthe tutorial in .PDF and .ODT formats, and the complete application before the chapter 1, before the chapter [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Continuation of the <a href="http://rossoft.wordpress.com/2006/06/23/working-on-a-extension-of-the-blog-tutorial/">extension blog tutorial.</a></p>
<p><title></title>Chapter 3: Ajax and Cookies. Saving a draft of the editing post in cookies through transparent periodicall ajax calls with feedback effects to the user.</p>
<p>Now you can get a .tgz file that containsthe tutorial in .PDF and .ODT formats, and the complete application before the chapter 1, before the chapter 3 and after the chapter 3. You can&#8217;t get stuck anywhere.</p>
<p><a href="http://www.ros-soft.net/otros/cakephp_blog/blog_tutorial.pdf">Download directly PDF version</a> or <a href="http://www.ros-soft.net/otros/cakephp_blog/blog_tutorial.tgz">download the complete .tgz with source code.</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/87/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/87/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=87&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/06/24/blog-tutorial-chapter-3-done/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Working on a extension of the blog tutorial</title>
		<link>http://rossoft.wordpress.com/2006/06/23/working-on-a-extension-of-the-blog-tutorial/</link>
		<comments>http://rossoft.wordpress.com/2006/06/23/working-on-a-extension-of-the-blog-tutorial/#comments</comments>
		<pubDate>Fri, 23 Jun 2006 14:10:03 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/06/23/working-on-a-extension-of-the-blog-tutorial/</guid>
		<description><![CDATA[I&#8217;m building a ampliation of the blog tutorial of the manual. It starts between the manual tutorial and the 2nd tutorial in the wiki.It will do a walk through some cool things in Cake. It has a lot of screenshots.
This is the first two chapters, cool flash messages + some error handling.
They&#8217;re a recopilation of [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m building a ampliation of the blog tutorial of the manual. It starts between the <a href="http://manual.cakephp.org/chapter/18">manual tutorial</a> and the<a href="http://wiki.cakephp.org/tutorials:blog_tutorial_-_2"> 2nd tutorial in the wiki.</a><br />It will do a walk through some cool things in Cake. It has a lot of screenshots.</p>
<p>This is the first two chapters, cool flash messages + some error handling.</p>
<p>They&#8217;re a recopilation of useful blog posts on the well-known CakePHP blogs.</p>
<p><a href="http://www.ros-soft.net/otros/cakephp_blog/blog_tutorial.pdf">Download directly PDF version</a> or <a href="http://www.ros-soft.net/otros/cakephp_blog/blog_tutorial.tgz">download the complete .tgz with source code.</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/86/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/86/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=86&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/06/23/working-on-a-extension-of-the-blog-tutorial/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CakePhp Cheat Sheet</title>
		<link>http://rossoft.wordpress.com/2006/06/23/cakephp-cheat-sheet/</link>
		<comments>http://rossoft.wordpress.com/2006/06/23/cakephp-cheat-sheet/#comments</comments>
		<pubDate>Fri, 23 Jun 2006 09:14:26 +0000</pubDate>
		<dc:creator>rossoft</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://rossoft.wordpress.com/2006/06/23/cakephp-cheat-sheet/</guid>
		<description><![CDATA[Download the nate&#39;s cheatsheet of CakePhp in pdf format HERE
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Download the nate&#39;s cheatsheet of CakePhp in pdf format <a href="http://cakephp.org/files/cakesheet.pdf">HERE</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rossoft.wordpress.com/85/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rossoft.wordpress.com/85/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rossoft.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rossoft.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rossoft.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rossoft.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rossoft.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rossoft.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rossoft.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rossoft.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rossoft.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rossoft.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rossoft.wordpress.com&blog=100122&post=85&subd=rossoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rossoft.wordpress.com/2006/06/23/cakephp-cheat-sheet/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>