Good day!

Colleagues, tell me, how can I use several file header templates? It means a cap with comments.

/** * Created by PhpStorm. * User: User * Date: 29.08.14 * Time: 1:48 */ 

I need it for transparent switching of copyrights for different projects.

Thanks in advance for the answers!

    2 answers 2

    Starting from version 11, PhpStorm comes with a Copyright plugin specially designed for this purpose.

    Copyright Profiles

    First you need to create profiles in Settings> Editor> Copyright> Copyright Profiles, then you can set one of them by default or distribute them to the corresponding Scopes.

    enter image description here

    The plugin allows you to customize the style of comments, their location in the file, automatically update the copyright blocks in the presence of a keyword, etc. The tutorial in English is available in the JetBrains blog .

    • Thank! Exactly what was needed!) - BrusSENS

    If I understand you correctly, then go: Settings> Editor> File and Code Templates. In the right window, select the Includes tab, look at the "PHP File Header" template and create your "header" templates in its image. enter image description here

    • Thanks for the answer, but I meant the creation of additional templates. Because constantly changing templates is not very convenient. - BrusSENS
    • @BrusSENS There are a few buttons on top. Among them, a button for creating a new template and copying, i.e. creation from existing. - Deonis
    • I created a new one, there are no problems with this, but here’s how to make it use this template to create, for example, a php file, that’s what I’m talking about. I apologize if I did not convey this essence in the question. - BrusSENS
    • @BrusSENS Go to the "Files" tab and, for example, in the PHP Class template for one project, connect the "Header for Apple.php" header, for the other - "Header for Microsoft.php", etc. That is, change the following code: #parse("PHP File Header.php") - Deonis
    • Yes, I did it. It turns out that you will need to create several identical file types and when creating a file, select, for example, "Php File Type1"? If so, then of course it's a pity, I thought you could attach to the project. - BrusSENS