简体   繁体   中英

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? It works flawlessly in .php and .html files but not in .tpl files.

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

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).
  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)

more info about Live Templates here: Live Templates
& about variables here: variables

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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