PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Creating files from templates

Last modified: 06 September 2023

PhpStorm provides file templates for most of the languages that it supports. This lets you create the files with the initial content appropriate for the file purpose. For example, there are file templates for HTML/HTML5/XHTML, XML, and JavaScript files, PHP classes and files, XSLT Style Sheets, and other supported file types.

Generally, the filename extension for a template-based file is set automatically, so you don't need to specify it. For example, if you create a JavaScript file, it gets the .JS extension. New HTML and XML files get the .HTML and .XML extensions respectively. New XSLT Style Sheets get the .XSL extension.

Sometimes, you are given an opportunity to select the desired extension from the list. This, for example, is the case when creating PHP classes.