free hit counter

Editing .ctp Files in Dreamwaver and Eclipse

Editing .ctp Files in Dreamwaver

In Dreamweaver, by default,we can’t edit our codes in .ctp script in the code or design views. Using Dreamweaver configuration, we can set it up.
Here we will see the proper configuration for
1.Viewing   CTP and THTML files in code view with PHP syntax coloring
2.Viewing  CTP and THTML files in Design view

Dreamweaver 8:

On windows XP :

C:\Program Files\Macromedia\Dreamweaver 8\Configuration\DocumentTypes\MMDocumentTypes.xml

Search the following codes with (<documenttype id=”PHP_MySQL” ) and change it as below:

<documenttype id=”PHP_MySQL” servermodel=”PHP MySQL” internaltype=”Dynamic” winfileextension=”php,php3,php4,php5,ctp,thtml” macfileextension=”php,php3,php4,php5,ctp,thtml” file=”Default.php” writebyteordermark=”false”>

and Save this file.To see the changes effective you have to restart Dreamweaver.You’ll now notice that your *.ctp files have an icon and isn’t a blank white file.You can double click on them and they will open up, and you can view it in Design view.

Dreamweaver CS4:

For this we are in need to edit two files:
1. On Vista, this is in your USER directory, NOT the one in the main Dreamweaver directory.

E.g.: C:\Users\[Your Username]\AppData\Roaming\Adobe\Dreamweaver CS4\en_US
\Configuration\Extensions.txt

Edit the first line that defines all the documents.
Add, “,CTP,THTML” before  “:All Documents”  (note the capital letters)

Find the PHP line and add “,CTP,THTML” before “:PHP Files”

and Save this file.

2.Now go here: C:\Program Files\Adobe\Adobe Dreamweaver CS4\configuration
\DocumentTypes\MMDocumentTypes.xml

If you try to edit this on Vista, it will say that you don’t have permission – right click on the file, set the security permissions to allow you to edit it.

Search for “<documenttype id=”PHP_MySQL” “

On this line, there are two parameters: 1.winfileextension=”php,php3,php4,php5″
– Add “,ctp,thtml” to this parameter

2. macfileextension=”php,php3,php4,php5″
– Add “,ctp,thtml” to this parameter

and Save this file.To see the changes effective you have to restart Dreamweaver.You’ll now notice that your *.ctp files have an icon and isn’t a blank white file.You can double click on them and they will open up, and you can view it in Design view.

 

cakephp

Editing .ctp Files in Dreamwaver and Eclipse

Editing *.ctp file in Eclipse.

Eclipse is a famous editor for the development with php. But to code with cakephp we need to configure this eclipse editor. Because by default eclipse does not hightlight the html or php syntex of cakephp view file.Here are the steps to set up eclipse for highlighting the codes in a .ctp file.

  • Firstly open the  Eclipse workspace.
  • Now go to Preferences from Window menu.
  • From Preference click on the General tab from the list.
  • Now click on Content-Types under General  tab.
  • On the right panel in the Content-Types, expand the Text tab.
  • Select PHP Content-Types .
  • There are all the lists of  files associated with php in below e.g. *.php,*.php3,*.php4
  • Now click on the Add button and type the fie extension e.g. *.ctp in the content type input field.

Now you need to reopen the file  you are working on.

Leave a Reply