forked from Medalink/laravel-blade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.blade
71 lines (53 loc) · 1.15 KB
/
test.blade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{{-- Echo --}}
Hello, {{ $name }}.
The current UNIX timestamp is {{ time() }}.
{{-- Echo: Escape Output --}}
Hello, {{{ $name }}}.
{{-- Define Blade Layout --}}
<html>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
{{-- Use Blade Layout --}}
@extends('layouts.master')
@section('sidebar')
@parent
<p>This is appended to the master sidebar.</p>
@stop
@section('sidebar')
@overwrite
<p>This replaces the master sidebar.</p>
@stop
@section('content')
<p>This is my body content.</p>
@stop
{{-- If Statement --}}
@if (count($records) > 0)
I have records!
@else
I don't have any records!
@endif
@unless (Auth::check())
You are not signed in.
@endunless
{{-- Loops --}}
@for ($i = 0; $i < 10; $i++)
The current value is {{ $i }}
@endfor
@foreach ($users as $user)
<p>This is user {{ $user->id }}</p>
@endforeach
@while (true)
<p>I'm looping forever.</p>
@endwhile
{{-- Include --}}
@include('view.name')
{{-- Language --}}
@lang('language.line')
@choice('language.line', 1);