D
D
Darth Moul2021-12-02 10:50:26
PHP
Darth Moul, 2021-12-02 10:50:26

How to write a snippet that will work inside the html attribute in the VS Code editor?

I wrote a snippet for HTML and PHP files in VS Code that fires when I start writing php and wraps it all in <?php ?>

"php": {
    "prefix": "php",
    "body": [
      "<?php $0 ?>"
    ],
    "description": "php tag"
  },

The thing is, the snippet doesn't work when I edit an attribute and try to insert a <?php ?> construct there.

A good example: I have a link to change , I want to enter php in the href="" attribute and so that I can choose a snippet that will insert <?php ?> , but this does not happen. Please suggest a solution, thanks. <a href=""></a>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question