让Volt模板引擎在PhpStome中语法高亮

(原文链接:http://www.okyo.cn/article/3/102.html)

Phalcon开发网站时自然会用到自带的volt引擎,但是PhpStorm默认并不支持volt的语法着色十分不友好。

好在phalcon文档中有这么一段“Volt is inspired by Jinja, originally created by Armin Ronacher. Therefore many developers will be in familiar territory using the same syntax they have been using with similar template engines. Volt’s syntax and features have been enhanced with more elements and of course with the performance that developers have been accustomed to while working with Phalcon.(Volt的灵感来源于 Twig 。最初由Armin Ronacher创建,而它则是受 Jinja 的启发。 因此,许多已经在使用Twig的开发人员将熟练的使用相同的语法。Volt的语法和功能更为强大,更多的元素以及更强的性能。)”。

既然灵感来源于Twig语法又相同,那么就让PhpStorm把.volt当做.twig来着色吧。

说了一大堆,其实配置方法很简单,打开设置界面,在Editor下找到File Types 在Twig下添加*.volt,“Apply”! 愉快的敲代码吧。
(配图一副)

让Volt模板引擎在PhpStome中语法高亮