Forked from CiprianSpiridon/Laravel-Blade-Template-Cheatsheet
Created
June 24, 2016 17:11
-
-
Save icheernoom/03145d6af7e324375de8d541acce09d2 to your computer and use it in GitHub Desktop.
Revisions
-
CiprianSpiridon revised this gist
Oct 27, 2014 . 1 changed file with 31 additions and 32 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,32 +1,31 @@ {{ $var }} - Echo content {{ $var or 'default' }} - Echo content with a default value {{{ $var }}} - Echo escaped content {{-- Comment --}} - A Blade comment @extends('layout') - Extends a template with a layout @if(condition) - Starts an if block @else - Starts an else block @elseif(condition) - Start a elseif block @endif - Ends a if block @foreach($list as $key => $val) - Starts a foreach block @endforeach - Ends a foreach block @for($i = 0; $i < 10; $i++) - Starts a for block @endfor - Ends a for block @while(condition) - Starts a while block @endwhile - Ends a while block @unless(condition) - Starts an unless block @endunless - Ends an unless block @include(file) - Includes another template @include(file, ['var' => $val,...]) - Includes a template, passing new variables. @each('file',$list,'item') - Renders a template on a collection @each('file',$list,'item','empty') - Renders a template on a collection or a different template if collection is empty. @yield('section') - Yields content of a section. @show - Ends section and yields its content @lang('message') - Outputs message from translation table @choice('message', $count) - Outputs message with language pluralization @section('name') - Starts a section @stop - Ends section @endsection - Ends section @append - Ends section and appends it to existing of section of same name @overwrite - Ends section, overwriting previous section of same name -
CiprianSpiridon revised this gist
Oct 27, 2014 . 1 changed file with 32 additions and 30 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,30 +1,32 @@ <ul> <li><code>{{ $var }}</code> - Echo content</li> <li><code>{{ $var or 'default' }}</code> - Echo content with a default value</li> <li><code>{{{ $var }}}</code> - Echo escaped content</li> <li><code>{{-- Comment --}}</code> - A Blade comment</li> <li><code>@extends('layout')</code> - Extends a template with a layout</li> <li><code>@if(condition)</code> - Starts an <strong>if</strong> block</li> <li><code>@else</code> - Starts an <strong>else</strong> block</li> <li><code>@elseif(condition)</code> - Start a <strong>elseif</strong> block</li> <li><code>@endif</code> - Ends a <strong>if</strong> block</li> <li><code>@foreach($list as $key => $val)</code> - Starts a <strong>foreach</strong> block</li> <li><code>@endforeach</code> - Ends a <strong>foreach</strong> block</li> <li><code>@for($i = 0; $i < 10; $i++)</code> - Starts a <strong>for</strong> block</li> <li><code>@endfor</code> - Ends a <strong>for</strong> block</li> <li><code>@while(condition)</code> - Starts a <strong>while</strong> block</li> <li><code>@endwhile</code> - Ends a <strong>while</strong> block</li> <li><code>@unless(condition)</code> - Starts an <strong>unless</strong> block</li> <li><code>@endunless</code> - Ends an <strong>unless</strong> block</li> <li><code>@include(file)</code> - Includes another template</li> <li><code>@include(file, ['var' => $val,...])</code> - Includes a template, passing new variables.</li> <li><code>@each('file',$list,'item')</code> - Renders a template on a collection</li> <li><code>@each('file',$list,'item','empty')</code> - Renders a template on a collection or a different template if collection is empty.</li> <li><code>@yield('section')</code> - Yields content of a section.</li> <li><code>@show</code> - Ends section and yields its content</li> <li><code>@lang('message')</code> - Outputs message from translation table</li> <li><code>@choice('message', $count)</code> - Outputs message with language pluralization</li> <li><code>@section('name')</code> - Starts a section</li> <li><code>@stop</code> - Ends section</li> <li><code>@endsection</code> - Ends section</li> <li><code>@append</code> - Ends section and appends it to existing of section of same name</li> <li><code>@overwrite</code> - Ends section, overwriting previous section of same name</li> </ul> -
CiprianSpiridon revised this gist
Oct 27, 2014 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,8 @@ {{ $var }} - Echo content {{ $var or 'default' }} - Echo content with a default value {{{ $var }}} - Echo escaped content {{-- Comment --}} - A Blade comment `@extends('layout')` - Extends a template with a layout @if(condition) - Starts an if block @else - Starts an else block @elseif(condition) - Start a elseif block -
CiprianSpiridon created this gist
Oct 27, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ {{ $var }} - Echo content {{ $var or 'default' }} - Echo content with a default value {{{ $var }}} - Echo escaped content {{-- Comment --}} - A Blade comment @extends('layout') - Extends a template with a layout @if(condition) - Starts an if block @else - Starts an else block @elseif(condition) - Start a elseif block @endif - Ends a if block @foreach($list as $key => $val) - Starts a foreach block @endforeach - Ends a foreach block @for($i = 0; $i < 10; $i++) - Starts a for block @endfor - Ends a for block @while(condition) - Starts a while block @endwhile - Ends a while block @unless(condition) - Starts an unless block @endunless - Ends an unless block @include(file) - Includes another template @include(file, ['var' => $val,...]) - Includes a template, passing new variables. @each('file',$list,'item') - Renders a template on a collection @each('file',$list,'item','empty') - Renders a template on a collection or a different template if collection is empty. @yield('section') - Yields content of a section. @show - Ends section and yields its content @lang('message') - Outputs message from translation table @choice('message', $count) - Outputs message with language pluralization @section('name') - Starts a section @stop - Ends section @endsection - Ends section @append - Ends section and appends it to existing of section of same name @overwrite - Ends section, overwriting previous section of same name