How to Add File Types to the PHP Editor

Follow

Applies To:

[ Zend Studio for Eclipse 6.x ]
[ All operating systems ]

Overview

Zend Studio for Eclipse has a number of pre-defined file extensions associated with a specific content type and editor. For example the .html extension has the Text/HTML content type and is by default opened with the Eclipse HTML Editor. However, not all possible file extensions have pre-defined associations in Zend Studio for Eclipse. If you are trying to open a file with an unknown extension, the Eclipse platform doesn't know how to handle such a file. At this point the behavior differs, from error messages to total lockup of the program. The behavior basically depends on the environment (operating system and its configuration).

Instructions

This article explains how to associate a new file extension with PHP Editor. The example is based on associating .tpl extension with PHP content type and PHP Editor. To enable Zend Studio to open *.tpl files as regular PHP code, proceed as follows:

  1. In Zend Studio go to Window | Preferences (on MacOS - Zend Studio for Eclipse | Preferences)
  2. In the Preferences dialog open the hierarchy General | Content types
  3. On the Content Types page select Text | PHP Content type
  4. Click Add

  1. In the Add Content Type Association dialog enter *.tpl and click OK

  1. In the Preferences dialog open the hierarchy General | Editor | File Associations
  2. On the File Associations page click the Add button next to the File types list

  1. In the Add File Type dialog enter *.tpl and click OK

  1. To verify that the procedure was succesful, verify that the *.tpl files are associated with the usual set of PHP editors on the File Associations page.

Result

From now on the *.tpl files can be opened in Zend Studio for Eclipse. Similar procedure can be applied to other file types, for example *.template and *.module.

 


Excerpt: This article explains how to associate an unknown file extension (*.tpl, *.template, *.module) with the PHP Editor in Zend Studio for Eclipse.

Original Post Date: 2009-04-14 19:13:48

Alternative Description:

This article explains how to associate an unknown file extension (*.tpl, *.template, *.module) with the PHP Editor in Zend Studio for Eclipse.

_____
Tags: .module,.tpl,Apple OS X 10.7 (Lion),Apple OS X 10.8 (Mountain Lion),Apple OS X 10.9 (Mavericks),association,content type,Debian / Ubuntu,Extension,file type,MacOS 10.6 and earlier,MS Windows 2003 Server,MS Windows 2008 Server,MS Windows 2012 Server,MS Windows 7,MS Windows 8,MS Windows XP,PHP Editor,RedHat Enterprise Linux / CentOS,SUSE Linux Enterprise Server / OpenSUSE,template,Zend Studio 10.x,Zend Studio 11.x,Zend Studio 7.x,Zend Studio 8.x,Zend Studio 9.x,Zend Studio for Eclipse 6.x,oldKB,attachment

Comments