フロントにおけるLaravel Laravel.hiroshima

フロントにおけるLaravel Laravel.hiroshima

B05baacb6000fe55fe558ce75aa9bc74?s=128

Haruki Tazoe

November 24, 2019
Tweet

Transcript

  1. 13.

    αϯϓϧίʔυ <!—- resources/views/layouts/app.blade.phpͱͯ͠อଘ —-> <html> <head> <title>αϯϓϧΞϓϦ - @yield(‘title’)</title> </head>

    <body> @section(‘sidebar’) ͕͜͜ϝΠϯͷαΠυόʔ @show <div class=“container”> @yield(‘content’) </div> </body> </html>
  2. 17.

    αϯϓϧίʔυ <!-- resources/views/child.blade.phpͱͯ͠อଘ --> @extends('layouts.app') @section('title', 'Page Title') @section('sidebar') @@parent

    <p>͜͜͸ϝΠϯͷαΠυόʔʹ௥Ճ͞ΕΔ</p> @endsection @section('content') <p>͕͜͜ຊจͷίϯςϯπ</p> @endsection
  3. 24.
  4. 32.

    αϯϓϧίʔυ @for ($i = 0; $i < 10; $i++) ݱࡏͷ஋͸ɿ

    {{ $i }} @endfor @foreach ($users as $user) <p>͜Ε͸ {{ $user->id }} ϢʔβʔͰ͢ɻ</p> @endforeach @forelse ($users as $user) <li>{{ $user->name }}</li> @empty <p>Ϣʔβʔͳ͠</p> @endforelse @while (true) <p>ແݶϧʔϓத</p> @endwhile
  5. 40.

    αϯϓϧίʔυ <!-- /resources/views/post/create.blade.php --> <label for="title">Post Title</label> <input id="title" type="text"

    class="@error('title') is-invalid @enderror"> @error('title') <div class="alert alert-danger">{{ $message }}</div> @enderror
  6. 43.