Sunday, October 23, 2011

CakePHP support in NetBeans

NetBeans is a very powerful development environment for many languages including PHP. With the release of its latest version, NetBeans announced full support for symfony PHP framework. NetBeans can also support many other PHP frameworks and libraries although it is not officially supported by NetBeans. This support needs some effort to enable some tools specially auto-complete, or intellisense, which saves a lot of time for developers.

http://www.tiplite.com/cakephp-support-in-netbeans/

Using CakePHP with Aptana

  • From the Window menu, select Preferences…, and then choose General > Editors > File Associations.
  • Add the appropriate file type.
  • Next to the File Types list, click the Add button.
  • In the New File Type pop-up window, type the appropriate file extension (e.g. “.ctp” or “.thtml”).
  • Click OK to add the New File Type to the List.
  • Associate the new file type with Aptana.
  • On the File Types list, select the file type that you just added.
  • Next to the Editor Associations list, click the Add button.
  • On the Editor Selection pop-up window, select the editor that you want to associate with your file type.
  • Click OK to add the editor.
  • The new is now associated with the specified file type.
  • Click OK to apply your changes and close the Preferences window.

CakePHP and Dreamweaver

  • Go to your Dreamweaver installation folder (let’s assume this is C:\Program Files\Adobe\Adobe Dreamweaver CS3)
  • Open the configuration folder
  • Edit extensions.txt and modify the first line so THTML and CTP are present (comma seperated. It should look something like this: ,MASTER,THTML,CTP:All Documents
  • Edit the PHP files line in the same way. It should look like this: PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files
  • Now browse to the DocumentTypes folder and open MMDocumentTypes.xml.
  • Do a ctrl-f search for “winfileextension” and modify the line to look like this: winfileextension=”php,php3,php4,php5,thtml,ctp”
  • Do the same for “macfileextension”: macfileextension=”php,php3,php4,php5,thtml,ctp”
  • Now go to your “Document and Settings” folder (found under your username e.g. “C:\Documents and Settings\Your User Name\Application Data\Adobe\Dreamweaver 9\Configuration”
  • Edit “Extensions.txt” and add the same lines you added to the other extensions file.

CakePHP and Eclipse

To set up your version of Eclipse to read either file type, follow these steps:
  • Go to Window > Preferences > General > Content types
  • In the content types window navigate the tree to text > PHP content type
  • Click add
  • Enter *.ctp or *.thtml depending on what version of CakePHP you use. It might be best to add both – just in case.
  • Now navigate to Editors > File Associations
  • Enter *.ctp or *.thtml depending on what version of CakePHP you use.
  • Under “Associated Editors:”, select the PHP Editor and click Default.