Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

Haruki Tazoe
November 24, 2019

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

Haruki Tazoe

November 24, 2019
Tweet

More Decks by Haruki Tazoe

Other Decks in Programming

Transcript

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

    <p>͜͜͸ϝΠϯͷαΠυόʔʹ௥Ճ͞ΕΔ</p> @endsection @section('content') <p>͕͜͜ຊจͷίϯςϯπ</p> @endsection
  3. αϯϓϧίʔυ @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
  4. αϯϓϧίʔυ <!-- /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