Skip to content

Commit 1edae7c

Browse files
committed
formatting
1 parent 3ab5778 commit 1edae7c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

blade.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,9 @@ Of course, if you attempt to `@include` a view which does not exist, Laravel wil
337337

338338
@includeIf('view.name', ['some' => 'data'])
339339

340-
If you want to `@include` a view that depends on a condition you can use `@includeWhen`:
340+
If you would like to `@include` a view depending on a given boolean condition, you may use the `@includeWhen` directive:
341341

342-
@php
343-
$display = true;
344-
@endphp
345-
@includeWhen($display, 'view.name', ['some' => 'data'])
342+
@includeWhen($boolean, 'view.name', ['some' => 'data'])
346343

347344
> {note} You should avoid using the `__DIR__` and `__FILE__` constants in your Blade views, since they will refer to the location of the cached, compiled view.
348345

0 commit comments

Comments
 (0)