{"id":784,"date":"2019-05-12T15:27:25","date_gmt":"2019-05-12T06:27:25","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=784"},"modified":"2019-07-07T12:41:56","modified_gmt":"2019-07-07T03:41:56","slug":"blade%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88-%e3%83%87%e3%82%a3%e3%83%ac%e3%82%af%e3%83%86%e3%82%a3%e3%83%96%e3%81%ae%e4%bd%bf%e7%94%a8%e4%be%8b-laravel5-8","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=784","title":{"rendered":"Blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 \u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u4f7f\u7528\u4f8b Laravel5.8"},"content":{"rendered":"<div class=\"overview_box\">\n<a href=\"https:\/\/dennie.tokyo\/it\/?p=734\" rel=\"noopener noreferrer\" target=\"_blank\">\u524d\u56de<\/a>\u306f\u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u4f7f\u7528\u4f8b\u3092\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<!--more--><br \/>\n\u4eca\u56de\u306f\u524d\u56de\u4f7f\u7528\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3068\u305d\u306e\u4ed6\u306e\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\n<\/div>\n<h5 class=\"title\">\u524d\u63d0<\/h5>\n<div class=\"sub_title\">\u30d5\u30a1\u30a4\u30eb\u69cb\u6210<\/div>\n<div class=\"sentence_box\">\n\u4eca\u56de\u4f7f\u7528\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\n<\/div>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n<table class=\"table\">\n<thead>\n<tr>\n<th scope=\"col\">\u30d5\u30a1\u30a4\u30eb\u540d<\/th>\n<th scope=\"col\">\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>resources\/views\/layouts\/main.blade.php<\/td>\n<td>\u89aa\u30d3\u30e5\u30fc(\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb)<\/td>\n<\/tr>\n<tr>\n<td>resources\/views\/directive\/directive.blade.php<\/td>\n<td>\u5b50\u30d3\u30e5\u30fc(\u30b3\u30f3\u30c6\u30f3\u30c4\u30d5\u30a1\u30a4\u30eb)<\/td>\n<\/tr>\n<tr>\n<td>resources\/views\/directive\/include.blade.php<\/td>\n<td>\u5916\u90e8\u8aad\u307f\u8fbc\u307f\u30d5\u30a1\u30a4\u30eb<\/td>\n<\/tr>\n<tr>\n<td>routes\/web.php<\/td>\n<td>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"sub_title\">\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0<\/div>\n<div class=\"sentence_box\">\n\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"web.php\" >Route::get('\/directive', function () {\r\n    return view('directive.directive');\r\n});<\/pre>\n<h5 class=\"title\">php\u8a18\u8ff0<\/h5>\n<div class=\"sentence_box\">\n@php\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306fphp\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u8a18\u8ff0\u304c\u53ef\u80fd\u3067\u3059\u3002\n<\/div>\n<pre class=\"lang:default decode:true \" >@php\r\n  $value = 1;\r\n@endphp<\/pre>\n<h5 class=\"title\">\u7d99\u627f<\/h5>\n<div class=\"sentence_box\">\n\u5b50\u30d3\u30e5\u30fc\u3067\u306f\u89aa\u30d3\u30e5\u30fc\u3092\u7d99\u627f\u3057\u3001\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<a href=\"https:\/\/dennie.tokyo\/it\/?p=734\" rel=\"noopener noreferrer\" target=\"_blank\">Blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 \u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u5229\u7528<\/a>\u3092\u53c2\u7167\u3057\u3066\u4e0b\u3055\u3044\u3002\n<\/div>\n<h5 class=\"title\">\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u8aad\u307f\u8fbc\u307f<\/h5>\n<div class=\"sub_title\">@yield, @section<\/div>\n<div class=\"sentence_box\">\n\u89aa\u30d3\u30e5\u30fc\u3067@yield\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u3001\u5b50\u30d3\u30e5\u30fc\u306e@section\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<br \/>\n\u5b50\u30d3\u30e5\u30fc\u306e@section\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u306f\u3001\u89aa\u30d3\u30e5\u30fc\u306e@yield\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u6307\u5b9a\u3057\u305f\u7b2c\u4e00\u5f15\u6570\u3068\u540c\u3058\u5185\u5bb9\u3092\u7b2c\u4e00\u5f15\u6570\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u3001\u89aa\u30d3\u30e5\u30fc\u306e\u4f8b\u3067\u306f@yield\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306b&#8217;title&#8217;\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305f\u5b50\u30d3\u30e5\u30fc\u306e\u4f8b\u3067\u3082@section\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u7b2c\u4e00\u5f15\u6570\u3092&#8217;title&#8217;\u3068\u3057\u3066\u3044\u307e\u3059\u3002\n<\/div>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n\u3055\u3089\u306b\u3001@section\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u7b2c\u4e8c\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u753b\u9762\u306b\u305d\u306e\u5185\u5bb9\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br \/>\n\u7b2c\u4e8c\u5f15\u6570\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001@endsection\u306e\u8a18\u8f09\u3092\u7701\u7565\u51fa\u6765\u307e\u3059\u3002\n<\/div>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n\u30fblayouts\/main.blade.php\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"main.blade.php\" >&lt;html&gt;\r\n    &lt;head&gt;&lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;main&gt;\r\n \r\n          &lt;h1&gt;\u30bf\u30a4\u30c8\u30eb - @yield('title')&lt;\/h1&gt;\r\n  \r\n          @yield('content')\r\n \r\n        &lt;\/main&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n\u30fbdirective\/directive.blade.php\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"directive.blade.php\" >&lt;!-- \u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u3002 --&gt;\r\n@extends('layouts.main')\r\n \r\n&lt;!-- \u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u3078\u30bf\u30a4\u30c8\u30eb\u3092\u8868\u793a\u3059\u308b\u3002 --&gt;\r\n@section('title', '\u30bf\u30a4\u30c8\u30eb')\r\n  \r\n&lt;!-- \u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u3078\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u8868\u793a\u3059\u308b\u3002 --&gt;\r\n@section('content')\r\n  &lt;p&gt;\u30b3\u30f3\u30c6\u30f3\u30c4&lt;\/p&gt;\r\n@endsection<\/pre>\n<div class=\"sub_title\">@section\u301c@show, @section<\/div>\n<div class=\"sentence_box\">\n@section\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f\u89aa\u30d3\u30e5\u30fc\u3067\u3082\u4f7f\u7528\u51fa\u6765\u307e\u3059\u3002<br \/>\n@yield\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3068\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u5b50\u30d3\u30e5\u30fc\u304b\u3089\u89aa\u30d3\u30e5\u30fc\u306e\u5185\u5bb9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002\n<\/div>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n\u30fblayouts\/main.blade.php\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"main.blade.php\" >&lt;html&gt;\r\n    &lt;head&gt;&lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;main&gt;\r\n \r\n          @section('top')\r\n            &lt;strong&gt;\u5171\u901a\u3067\u8868\u793a\u3057\u305f\u3044\u3002&lt;\/strong&gt;\r\n          @show\r\n \r\n        &lt;\/main&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n\u30fbdirective\/directive.blade.php\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"directive.blade.php\" >&lt;!-- \u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u3002 --&gt;\r\n@extends('layouts.main')\r\n\r\n&lt;!-- \u89aa\u30d3\u30e5\u30fc\u306e\u5185\u5bb9\u3092\u8868\u793a\u3057\u3064\u3064\u3001\u5b50\u30d3\u30e5\u30fc\u306e\u5185\u5bb9\u3092\u8868\u793a\u3059\u308b\u3002 --&gt;\r\n@section('top')\r\n    &lt;p&gt;\u4e0b\u306b\u89aa\u30d3\u30e5\u30fc\u306e\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u308b\u3002&lt;\/p&gt;\r\n    @parent\r\n@endsection\r\n<\/pre>\n<h5 class=\"title\">\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f<\/h5>\n<div class=\"sub_title\">@include<\/div>\n<div class=\"sentence_box\">\n@include\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u4f8b\u306f\u3001directive.blade.php \u304b\u3089 include.blade.php \u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002\n<\/div>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n\u30fblayouts\/main.blade.php\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"main.blade.php\" >&lt;html&gt;\r\n    &lt;head&gt;&lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;main&gt;\r\n          @yield('content')\r\n        &lt;\/main&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n\u30fbdirective\/directive.blade.php\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"directive.blade.php\" >&lt;!-- \u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u3002 --&gt;\r\n@extends('layouts.main')\r\n\r\n&lt;!-- \u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080 --&gt;\r\n@section('content')\r\n  @include('directive.include')\r\n@endsection<\/pre>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n\u30fbdirective\/include.blade.php\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"include.blade.php\" >&lt;p style='color:#000080'&gt;\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3055\u308c\u305f\u3088\u3002&lt;\/p&gt;<\/pre>\n<h5 class=\"title\">\u307e\u3068\u3081<\/h5>\n<div class=\"sentence_box\">\n\u6b21\u56de\u306f<a href=\"https:\/\/dennie.tokyo\/it\/?p=725\" rel=\"noopener noreferrer\" target=\"_blank\">Blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 \u5236\u5fa1\u69cb\u6587\u8d85\u5165\u9580<\/a>\u3092\u8aac\u660e\u3057\u307e\u3059\u3002\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306f\u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u4f7f\u7528\u4f8b\u3092\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":968,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,4],"tags":[],"class_list":["post-784","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-php"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=784"}],"version-history":[{"count":29,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/784\/revisions"}],"predecessor-version":[{"id":906,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/784\/revisions\/906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/968"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}