Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 830 Bytes

language-template.md

File metadata and controls

43 lines (35 loc) · 830 Bytes

Templates (blade, smarty, twig…)

Please refer to Laravel “Blade Templates” article for style–guides about Blade templates.

Addendum

Control Structures

As decided in this issue, the following code…

<div>
    @if (count($records) === 1)
        <div>
            …
        </div>
    @endif
</div>

…should be written like so:

<div>
    @if (count($records) === 1)
    <div>
        …
    </div>
    @endif
</div>

In case of nested control structures and loops, align the markup with the closest template control:

<div>
    @if (isset($userProfile)
        @for ($i = 0; $i < 10; $i++)
        <p>User {{ $i }} […]</p>
        @endfor
    @endif
</div