Skip to content

Commit 27bbe18

Browse files
[blade] Single statement @php (laravel#8257)
* adds single-statement @ php * fixes word order * Update blade.md Co-authored-by: Taylor Otwell <[email protected]>
1 parent e6f5c5e commit 27bbe18

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

blade.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,12 @@ In some situations, it's useful to embed PHP code into your views. You can use t
593593
@endphp
594594
```
595595

596+
If you only need to write a single PHP statement, you can include the statement within the `@php` directive:
597+
598+
```blade
599+
@php($counter = 1)
600+
```
601+
596602
<a name="comments"></a>
597603
### Comments
598604

0 commit comments

Comments
 (0)