Updated package for use in Laravel 5 Blade templating.
Laravel5BladeSnippets
Blade
is a simple, yet powerful templating engine provided with [Laravel 5] (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 Laravel 5 Blade Snippets
then click/tap…wait a sec and tada!
Or clone this repository into your Packages folder:
git clone https://github.com/phillipmadsen/Laravel-5-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 ')) |
l5 form: textarea | see inside snippet |
l5 form: textfield | see inside snippet |
Original snippets by: @AAlakkad @dev4dev
Cool Readme formatting and latest updates belong to:
- Github: .@phillipmadsen
- Email: [email protected].