简体   繁体   English

如何使用PhpStorm在smarty模板中启用zencoding支持

[英]How to enable zencoding support in smarty templates with PhpStorm

How do you enable the ZenCoding "live templates" in .tpl smarty templates in Jetbrains PhpStorm? 如何在Jetbrains PhpStorm的.tpl smarty模板中启用ZenCoding“实时模板”? It works flawlessly in .php and .html files but not in .tpl files. 它可以在.php和.html文件中完美运行,但不能在.tpl文件中运行。

在“添加实时模板”对话框中,选择“其他”单选按钮。

I know this is a very old question but I just kinda stumbled upon it having the same lately. 我知道这是一个非常老的问题,但是最近我偶然发现了同样的问题。 What I did was: 我所做的是:

  1. Create a new .tpl file (or just write the needed template code in an existing .tpl file). 创建一个新的.tpl文件(或仅在现有的.tpl文件中编写所需的模板代码)。
  2. Select the lines of code you need as template. 选择您需要作为模板的代码行。
  3. Go to Tools->Save as Live Template... (NOT Save File as Template...). 转到“工具”->“另存为活动模板...”(不要将文件另存为模板...)。
  4. Add an Abbreviation and a Description and/or any Variables that you need. 添加缩写和描述和/或所需的任何变量。
    (use the $SELECTION$ variable if you need to surround a selection or $END$ if you need the pointer somewhere specific) (如果需要包围选择,请使用$ SELECTION $变量;如果需要在特定位置的指针,请使用$ END $)

more info about Live Templates here: Live Templates 有关实时模板的更多信息,请参见: 实时模板
& about variables here: variables &关于此处的变量变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM