"Surround with" command doesn't work on PHP tags

Example:

Is this expected?

 

0

Looks like the HTML templates don't work on PHP tags, but I think they should because they are part of the HTML. You can also notice that the IDE indents them the same way it indents HTML tags.

0

Hi,

If it is about “Surround with <tag></tag>” Live Template, you can try extending the context to the PHP in the “Settings/Preferences > Live Templates” settings section:

I have quickly tried it, and it seems to be working:

0

Thanks, look's like you can only check Other — making it less likely for the template to be suggested in the wrong context.

0

What's this?

Looks like you need this checked as well if you want the template to work around <?= … ?> tags.

0

Cool, thank you for the update!

Honestly, I have no idea what this exact setting is designed for. In my case, it works fine with the “PHP > Other” context alone.

0

Does it also work for <?= … ?> tags – that is, without also checking the “live.template.name…” option?

0

It does for me, at least on a pretty simple example:

0

请先登录再写评论。