<?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>Skidoosh &#187; CakePHP</title> <atom:link href="http://www.skidoosh.co.uk/category/cakephp/feed/" rel="self" type="application/rss+xml" /><link>http://www.skidoosh.co.uk</link> <description>Skidoosh - PHP, Python, Django, Ruby on Rails Web Developer in North Wales</description> <lastBuildDate>Sat, 12 Jun 2010 09:08:31 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>CakePHP Aptana and Eclipse PDT code completion that works</title><link>http://www.skidoosh.co.uk/php/cakephp-aptana-and-eclipse-pdt-code-completion-that-works/</link> <comments>http://www.skidoosh.co.uk/php/cakephp-aptana-and-eclipse-pdt-code-completion-that-works/#comments</comments> <pubDate>Thu, 17 Dec 2009 00:44:38 +0000</pubDate> <dc:creator>Glyn Mooney</dc:creator> <category><![CDATA[Aptana]]></category> <category><![CDATA[CakePHP]]></category> <category><![CDATA[Eclipse]]></category> <category><![CDATA[PHP]]></category><guid isPermaLink="false">http://www.skidoosh.co.uk/?p=68</guid> <description><![CDATA[A short guide on how to enable CakePHP auto completion within the Aptana Studio or Eclipse PDT IDE for Models within controllers and helpers. This actually works!]]></description> <content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.skidoosh.co.uk%2Fphp%2Fcakephp-aptana-and-eclipse-pdt-code-completion-that-works%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.skidoosh.co.uk%2Fphp%2Fcakephp-aptana-and-eclipse-pdt-code-completion-that-works%2F&amp;source=skidoosh&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br /> </a></div><p>I keep seeing people asking the question &#8220;How do I get code completion to work in Aptana and Eclipse PDT?&#8221;. A lot of the time I see the Helper fix but nothing else! With a bit of fiddling I&#8217;ve finally got a complete solution <strong>that works!</strong> Here how I did it:</p><p>Follow this guide to enable the .thtml or .ctp file extentions: <a href="http://bakery.cakephp.org/articles/view/setting-up-eclipse-to-work-with-cake" title="Setting up Eclipse to work with Cake" target="_blank">Setting up Eclipse to work with Cake</a></p><p>Create a dummy file in your cake root directory with the following code:</p><pre name="code" class="php">
&lt;?php
   exit();
   //declare and define all of the helpers
   //to helper enable codecompletion
   if(1 == 0) {
        $ajax = new AjaxHelper();
        $cache = new CacheHelper();
        $form = new FormHelper();
        $html = new HtmlHelper();
        $javascript = new JavascriptHelper();
        $number = new NumberHelper();
        $session = new SessionHelper();
        $text = new TextHelper();
        $time = new TimeHelper();
    }
?&gt;
</pre><p>Then to get the Model code completion from within controllers create an app_controller.php file in you app directory and add a dummy function with the following code:</p><pre name="code" class="php">
&lt;?php
    class AppController extends Controller {
        public function dummy () {
            //for each of your models add a definition and declaration
            //like the ones that follow
            $this->User = new User();
            $this->Post = new Post();
        }
    }
?&gt;
</pre><p>So with a bit of luck this will help you on your way. Thanks for reading!</p> ]]></content:encoded> <wfw:commentRss>http://www.skidoosh.co.uk/php/cakephp-aptana-and-eclipse-pdt-code-completion-that-works/feed/</wfw:commentRss> <slash:comments>0</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 4/13 queries in 0.003 seconds using disk

Served from: www.skidoosh.co.uk @ 2010-09-08 17:04:27 -->