Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to treat .tpl syntax highlighting like php's syntax highlighting in PHPStorm

Tags:

php

ide

phpstorm

I use PHPStorm

I need to know how could I treat .tpl files syntax highlighting like that of .php syntax highlighting?

like image 826
Mostafa Talebi Avatar asked Mar 26 '14 08:03

Mostafa Talebi


2 Answers

If you want to treat .tpl files in the same way as .php then you will have to re-assign *.tpl pattern to PHP type in Settings/Preferences | Editor | File Types

enter image description here
(screenshot is from current 2021.2 version)

The IDE will ask to confirm the removal of that pattern from the standard Smarty file type:

enter image description here

P.S. This is an IDE-wide setting and will affect all projects.

Sadly you cannot have the same pattern to be assigned to a different file type in different projects. Consider using double extension if it's possible: e.g. *.html.tpl -- this way you can use such additional pattern assigned to another file type.

like image 53
LazyOne Avatar answered Sep 26 '22 00:09

LazyOne


In PhpStorm configuration settings:

 File->Settings->Editor->File Types->php-> + -> add *.tpl

PHP storm site settings

like image 26
Viktorminator Avatar answered Sep 23 '22 00:09

Viktorminator