E
E
Elfer2020-07-03 13:54:13
phpstorm
Elfer, 2020-07-03 13:54:13

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.

5eff0e2e8a64c132373374.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bkosun, 2020-07-03
@Elfer

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.

S
Stalker_RED, 2020-07-03
@Stalker_RED

Probably short_open_tag support is disabled.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question