Radmation Radmation - 7 months ago 23
CSS Question

PhpStorm thinks <div> is open but it isn't with blade directives

Here is the code:

@if (count($errors) > 0)
<div class="errorClass">
<div class="cleanClass">
<p>Some stuff</p>

The above code make PhpStorm register that there is an open
. Any way to fix this bug?

This is making it frustrating to use when it comes time to refactor code.

I installed the Blade extension hoping that would help - it didn't. PhpStorm reports:

Element div is not closed.

Any way to make PhpStorm smarter?


(Posted on behalf of the OP).


This works but is not easy to read.

    @if (count($errors) > 0)
    <p>Here is a paragraph</p>

Best Situation for readability

@if (count($errors) > 0)
    <?php  $class = 'class="errorClass"' ?>
    <?php $class = 'class="cleanClass"'  ?>
<div <?= $class; ?>>
    <p>Blah blah</p>