Changing .latte file extension

byybora
Member | 2
+
0
-

Hi,

Is it possible to change the latte file extension? For ex: .latte.php

Thanks

dakur
Member | 493
+
0
-

@byybora Hi, yes, it is, it's just a convention and it has some consequences in IDE for example. But why would you do it?

Last edited by dakur (2021-01-22 11:25)

byybora
Member | 2
+
0
-

@dakur For example I am using PHPStorm and IDE keeps crashing due to latte plugin. In our content management system, we plan to switch to latte as a template engine and we want all users to adapt easily. We are currently in the testing and review phase.

I could not find how to change it in the documents, can you guide me? Thanks

Last edited by byybora (2021-01-27 10:08)

jiri.pudil
Nette Blogger | 1028
+
0
-

I don't think Latte cares about the extension at all, so if you're using stand-alone Latte, you can just $latte->render('template.latte.php') instead of $latte->render('template.latte'). As for PhpStorm, I guess you'll have to associate the extension to Latte file type (Settings > Editor > File Types).

dakur
Member | 493
+
+2
-

@byybora I don't think that switching file extensions permanently due to temporary bugs in Latte plugin for IDE is good idea. You can disable latte plugin and/or associate .latte extension with something else like Jirka wrote. Latte plugin has been fixed yesterday btw.