質問編集履歴
2
テンプレートの出典を追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,36 @@
|
|
1
|
-
たまに以下のようなクラスの静的メソッドの呼び出しのような記述を見かけます。
|
1
|
+
たまに以下のようなクラスの静的メソッドの呼び出し(以下のサンプルでは'mail::header'など)のような記述を見かけます。
|
2
2
|
|
3
|
+
|
4
|
+
php artisan vendor:publish --tag=laravel-mail にて公開したテンプレートの
|
5
|
+
resources/views/vendor/mail/html/message.blade.php
|
3
|
-
```
|
6
|
+
```blade
|
7
|
+
@component('mail::layout')
|
8
|
+
{{-- Header --}}
|
9
|
+
@slot('header')
|
4
|
-
@component('mail::
|
10
|
+
@component('mail::header', ['url' => config('app.url')])
|
11
|
+
{{ config('app.name') }}
|
12
|
+
@endcomponent
|
13
|
+
@endslot
|
14
|
+
|
15
|
+
{{-- Body --}}
|
16
|
+
{{ $slot }}
|
17
|
+
|
18
|
+
{{-- Subcopy --}}
|
19
|
+
@isset($subcopy)
|
20
|
+
@slot('subcopy')
|
21
|
+
@component('mail::subcopy')
|
22
|
+
{{ $subcopy }}
|
23
|
+
@endcomponent
|
24
|
+
@endslot
|
25
|
+
@endisset
|
26
|
+
|
27
|
+
{{-- Footer --}}
|
28
|
+
@slot('footer')
|
29
|
+
@component('mail::footer')
|
30
|
+
© {{ date('Y') }} {{ config('app.name') }}. @lang('All rights reserved.')
|
31
|
+
@endcomponent
|
32
|
+
@endslot
|
33
|
+
@endcomponent
|
5
34
|
```
|
6
35
|
|
7
36
|
- これはクラスメソッドを呼び出しているのでしょうか
|
1
目的追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,4 +5,6 @@
|
|
5
5
|
```
|
6
6
|
|
7
7
|
- これはクラスメソッドを呼び出しているのでしょうか
|
8
|
-
- どのようにすればこのやり方を自分でも実装できるでしょうか
|
8
|
+
- どのようにすればこのやり方を自分でも実装できるでしょうか
|
9
|
+
|
10
|
+
複雑なコンポーネントを考えており、もしコンポーネントの生成にクラスが利用できるのであれば検討したいと思っています。
|