<?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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sameer Ahuja &#187; CakePHP</title>
	<atom:link href="http://sameerahuja.com/blog/tags/cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://sameerahuja.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 09:15:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CakePHP and AJAX: First pitstop</title>
		<link>http://sameerahuja.com/blog/cakephp-and-ajax-first-pitstop/</link>
		<comments>http://sameerahuja.com/blog/cakephp-and-ajax-first-pitstop/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 08:35:59 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://sameerahuja.com/blog/2007/04/cakephp-and-ajax-first-pitstop/</guid>
		<description><![CDATA[I started out with the Cake framework for PHP some time back, and it&#8217;s been a mixed ride so far. Cake is a very powerful, but still somewhat incipient framework built on the MVC pattern of Ruby on Rails. Among it&#8217;s several cool features is inbuilt support for AJAX based applications. A good starter tutorial [...]]]></description>
			<content:encoded><![CDATA[<p>I started out with the Cake framework for PHP some time back, and it&#8217;s been a mixed ride so far. Cake is a very powerful, but still somewhat incipient framework built on the MVC pattern of Ruby on Rails. Among it&#8217;s several cool features is inbuilt support for AJAX based applications.</p>

<p>A good starter tutorial in that direction lies <a href="http://grahambird.co.uk/cake/tutorials/ajax.php">here</a>. And another one, a <a href="http://rossoft.wordpress.com/2006/06/04/tutorial-web-based-search-engine-for-flickr/">Flickr Gallery</a>.<br /><br />However, if you&nbsp;belong to the population of web developers who are <strong>not </strong>psychic <strong>or </strong>lucky, you would probably have&nbsp;something like this staring your face when you try the above tutorials -</p>

<blockquote> <p>Fatal error: Call to a member function on a non-object in [...]/cake/app/views/layouts/default.thtml on line 8</p></blockquote>

<p>That&#8217;s because both the tutorials do not explicitly mention that you need to declare the AJAX helper in the controller file if you are going to use AJAX features. The best way to do that is to copy the app_controller.php file from your cake/ directory, put it in your app/ directory and add the following piece of code to it:</p>

<p><pre class="brush: php;">var $helpers = array('Html', 'Ajax', 'Javascript');</pre>This declares the Helpers in the parent class of all the controllers, so that you don&#8217;t need to re-declare them later. If you do that, though, make sure to have all the helpers declared again.</p>
]]></content:encoded>
			<wfw:commentRss>http://sameerahuja.com/blog/cakephp-and-ajax-first-pitstop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 10/15 queries in 0.019 seconds using disk

Served from: sameerahuja.com @ 2012-05-19 09:04:38 -->
