Skip to content

Instantly share code, notes, and snippets.

@richjava
Created November 9, 2014 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richjava/f2fd0c91405ee27d6b64 to your computer and use it in GitHub Desktop.
Save richjava/f2fd0c91405ee27d6b64 to your computer and use it in GitHub Desktop.
Creating .phtml files in Netbeans
It is common practice to use .phtml files for view-related files but Netbeans (as at version 8.0) doesn't have out-of-the-box functionality to directly add them to a project. However, Netbean's Templates allow you to specify this functionality:
Firstly, create a folder called "Netbeans Templates" on your local machine with two files inside: "PHTML File.phtml" and "PHTML Web Page.phtml". Customize these files to your liking.
Go to Tools > Templates > PHP > Add, and then choose your file (do this for both).
The new item will be added but it will have the .phtml extension in the name (which we don't want). You can remove the extension by clicking on the file name and then clicking the Rename button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment