Answer the question
In order to leave comments, you need to log in
How to fix PhpStorm not recognizing PHP code inside div tags?
In PhpStorm, everything between div tags is recognized by the program as plain text. Opening and closing PHP tags are not recognized, PHP hints do not pop up, complete the name of a variable, suggest a method, function, etc. In general, as if there is ordinary text.
This is only where the opening div begins and before it closes, or any non-div inner tag.
I give an example in the picture, in this case the zone is highlighted in green, in which PhpStorm works as with ordinary text, until the table tag begins.
Answer the question
In order to leave comments, you need to log in
Settings -> Editor -> Language Injections
Check for a rule for the "div" tag in the "Scope" (HTML) column. If it exists, delete it.
This rule allows the IDE to treat all other code (even PHP) inside the "div" tag as HTML/plain text.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question