Smarty, custom tag highlight.
Hello!
Is it real to add highlighting for custom tag in .tpl files?
For example, at the moment PHPStorm highlight in orange color that .tpl tags like {foreach... {if... e.t.c
But can i add my custom tag to highlighting? For example {t} ? I use gettext localization in Smarty, and all my text to translate puted into this tag, so is it real to add them into highlight rules?
Attachment(s):
se.PNG
请先登录再写评论。
Hi there,
TBH -- no clue.
On one hand, accordingly to https://youtrack.jetbrains.com/issue/WI-1109 (which is marked as fixed) all custom tags registered via register_compiler_function() should automatically be detected and treated as Smarty tags. I personally have never used any custom tags (only functions/modifiers) so cannot tell how it supposed to work (if at all).
But then we have another request: https://youtrack.jetbrains.com/issue/WI-21389 (still pending) which asks for custom colors for custom tags .. but still asking on a way of how to list such custom tags.
Right now I may suggest:
1) Configure your editor color scheme for Smarty to have some background color for the whole tag -- this way you could see that this is a tag more easily.
2) If no JB devs/support will reply here in a day or two -- submit another Feature Request ticket asking to provide a way of providing a list of custom smarty tags that will be treated in a same way as standard tags (i.e. highlighting the same color etc)
Hi, Andriy !
As always, you all know. :D Many thanks for answer. ;)
Hello,
In our project we have custom Smarty tags:
{ia_add_js} {/ia_add_js}Thank you.
Yes -- check this comment (adjust to suit your tags): https://youtrack.jetbrains.com/issue/WI-10478#comment=27-743885
Thanks a lot.