HTML, PHP completions


How can i do for php works like html.

header.header + Tab gives **<header class="header"></header>**


header.header + Tab gives  header.<header></header>

Not Correct
Thanks for yoiu help


Is this provided by a package, or your own snippets?


By a package, i suppose
Here is my emmet packages:
emmet and emmet-snippets-compatibility.
Here is my snippets:

'.text.html.basic, .php':
      'prefix': 'html5'
      'body': """
      <!DOCTYPE html>
      <html lang="fr">
         <meta charset="UTF-8">
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <meta http-equiv="X-UA-Compatible" content="ie=edge">

  'div class':
      'prefix': 'cl'
      'body': """
      <div class="${1}">\n\t\t${0}\n</div><!-- .${1} -->
  'div id':
      'prefix': 'id'
      'body': """
      <div id="${1}">\n\t\t${0}\n</div><!-- #${1} -->
#----- PHP -----
      'prefix': 'if'
      'body': """
      <?php if (${1:condition}): ?>

      <?php endif ?>
      'prefix': 'ife'
      'body': """
      <?php if (${1:condition}): ?>
      <?php else: ?>
      <?php endif ?>
      'prefix': 'ifei'
      'body': """
      <?php if (${1:condition}): ?>
      <?php elseif (${2:condition}): ?>
      <?php endif ?>
      'prefix': '?'
      'body': '<?= $0 ?>'

Best regards


According to the emmet documentation, the default keybinding only works for HTML, CSS, Sass/SCSS, and Less. Follow the instructions on that page to make it work for PHP.


Thanks, but in Sublime Text, it works fine in html or php. I use atom due to a bug with my php version (7.2.2).
This is the last bothersome thing in atom.


Apparently the Atom package was implemented differently. As stated in the documentation I linked, you can change that.


If you beleive it to be a bug in emmet, I suggest you raise an issue on the relevant repository.

If you do, be sure to explain exactly what is happening, what you expect, why you expect it, the steps to reproduce from a blank file, etc. If you just say what you said here, you are likely to annoy the maintainers before they even consider it.


I have reinstalled emmet and emmet-snippets-compatibility, it seems work fine.
The problem is that css don’t work very well.