Blade
is a simple, yet powerful templating engine provided with [Laravel] (http://laravel.com) PHP framework.
These snippets works with blade files (.blade.php
) either with php syntax or with blade syntax using: PHP - Laravel Blade available from [Laravel Blade Highlighter] (https://github.com/Medalink/laravel-blade) package.
##Usage
When you're on a blade file, type the snippet shortcut then press tab
key.
##Installation
Via Package Manager
search for Blade Snippets
then click/tap…wait a sec and tadam!
Or clone this repository into your Packages folder:
git clone https://github.com/dev4dev/blade-snippets.git
Or download the snippets zip file and unzip it into your Packages folder.
##Avalable snippets
Shortcut | Result |
---|---|
ext | @extends('name ') |
lay | @layout('name ') |
sec | @section('name ') {{-- expr --}} @endsection |
secy | @section('name ') {{-- expr --}} @yield_section |
yl | @yield('section ', 'default ') |
lsec | @section('name ') {{-- expr --}} @show |
par | @parent |
!! | {!! $var !!} |
}} | {{ escaped output }} |
inc | @include('view.name ', array('some' => 'data') ) |
if | @if (condition ) {{-- expr --}} @endif |
ife | @if (condition ) {{-- expr --}} @else {{-- expr --}} @endif |
foreach | @foreach($array as $element ) {{-- expr --}} @endforeach |
fore | @forelse ($array as $element ) {{-- expr --}} @endforelse |
for | @for ($i = 0 ; $i < … ; $i++ ) {{-- expr --}} @endfor |
each | @each ('item.view ', $items , 'item ', 'empty.view ') |
trans | {{ trans('language.line ') }} |
route | {{ route('name ') }} |
asset | {{ asset('path ') }} |
while | @while (condition ) {{-- expr --}} @endwhile |
unless | @unless (condition ) {{-- expr --}} @endunless |
choise | @choice('language.line ', $number ) |
comment | {{-- comment --}} |
lang | @lang('language.line ', array('variable => 'replacement ')) |
Original snippets by: @dev4dev
Cool Readme formatting and latest updates belong to:
- Github: @AAlakkad.
- Twitter: @Am_Alakkad.
- Email: am.alakkad@gmail.com.