Masking File Extenstions in Netbeans

I recommend Netbeans as the best IDE for working on any kind of projects. Especially, for PHP developers netbeans bags lots of features. Here I am going to share one such feature.

In most of the projects, we are not going to use ‘php’ as the file extension for a php file. Lets say, when working on a custom MVC architecture, we will have controller files as student.controller, model files as student.model and some times view file as studentAttend.tpl.

Even in Drupal CMS, while working on modules we have modulename.module and modulename.test as the file extensions. But in all these case anyway we are going to use php script inside the file. But if you open these files in the IDE, php tags and commands will not be recognized since the file extension is different. For these conditions Netbeans comes with a solution with file extension masking feature. Using that we can instruct netbeans to consider any file extension as any file type. Now open your netbeans IDE and goto


	tools -> options -> Miscellaneous -> files

There under ‘File Associations’, you can select the file extension you want to mask from the ‘File Extension’ dropdown. If you could not find your extension in the menu, you can create a new one by clicking on the ‘New’ button. And enter your file extension in the small pop up box.

After selecting file extension, choose the file type that you want to associate from the MIME drop down. All the file extension supported by your netbeans installation will be listed in that drop down. Once the ‘Ok’ button is pushed your new file extension will be considered as the file type that you have chosen. Enjoy coding.

Don’t forget to comment on the post.