From f800fb0ea74fc164ac19c62f32cc8873f3e5208b Mon Sep 17 00:00:00 2001 From: Zayn Ali Date: Sat, 2 Jul 2016 02:09:52 +0500 Subject: [PATCH] Add (Blade Extensions) Missing Directives unset breakpoint embed endembed macrodef endmacro macro markdown endmarkdown minify --- blade.sublime-syntax | 4 +-- test.blade | 83 ++++++++++++++++++++++++++++++++++++++++++-- test.blade.php | 83 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 164 insertions(+), 6 deletions(-) diff --git a/blade.sublime-syntax b/blade.sublime-syntax index 3a04455..695812c 100644 --- a/blade.sublime-syntax +++ b/blade.sublime-syntax @@ -35,7 +35,7 @@ contexts: pop: true - include: 'scope:source.php' - - match: '(\s{0}|^)(\@)\b(debug|set|if|elseif|forelse|foreach|for|while|extends|unless|each|yield|lang|choice|section|include|render|block|can|inject|partial|hasSection|elsecan|elsecannot|stack|push|layout|continue|break)\b(?=(|\s*|)\()' + - match: '(\s{0}|^)(\@)\b(debug|embed|macrodef|set|unset|if|elseif|forelse|foreach|for|while|extends|unless|each|yield|lang|choice|section|include|render|block|can|inject|partial|hasSection|elsecan|elsecannot|stack|push|layout|continue|break|minify|macro)\b(?=(|\s*|)\()' captures: 0: entity.name.tag.block.any.html 1: constant.other.inline-data.html @@ -47,7 +47,7 @@ contexts: pop: true - include: 'scope:source.php' - - match: '(\s{0}|^)(\@)\b(empty|endif|endforelse|endforeach|endfor|endwhile|else|endunless|show|stop|endblock|endpartial|continue|break|endsection|parent|overwrite|endcan|append|endpush)\b' + - match: '(\s{0}|^)(\@)\b(breakpoint|endmacro|endembed|empty|endif|endforelse|endforeach|endfor|endwhile|else|endunless|show|stop|endblock|endpartial|continue|break|endsection|parent|overwrite|endcan|append|endpush|markdown|endmarkdown|endminify)\b' scope: custom.compiler.blade.php captures: 0: entity.name.tag.block.any.html diff --git a/test.blade b/test.blade index 79fce46..d3031d0 100644 --- a/test.blade +++ b/test.blade @@ -170,12 +170,91 @@ This comment will not be in the rendered HTML @endforeach -@set($now, new DateTime('now')) -@set('newvar', 'value') {{ $newvar }} +@set('newvar', 'value') +@set($now, new DateTime('now')) +@set('myArr', ['my' => 'arr']) +@set('myArr2', array('my' => 'arr')) + +@unset('newvar') +@unset($newvar) @debug($somearr) +// xdebug_break breakpoints (configurable) to debug compiled views. Sweet? YES! +@breakpoint + +@markdown +# Some markdown code +** with some bold text too ** +@endmarkdown + +@section('content') + @embed('components.panel', ['type' => 'danger', 'items' => ['first', 'second', 'third'] ]) + @section('content') +

Hello World!

+ @stop + @endembed +@stop + +@macrodef('divider', $class = 'divider', $role = 'seperator') + "; ?> +@endmacro + +
+

Title

+ + @macro("divider") + +

Paragraph

+
+ +@embed('blade-ext::dropdown', ['button' => true ]) + @section('label', 'Choose') + @section('items') + @macro('item', 'Action') + @macro('item', 'Another Action') + @macro('item', 'Something else here') + @macro('item', 'Separated link') + @stop +@endembed + + + + + +{{----------------------------------------}} + @can('permission', $entity) You have permission! @endcan diff --git a/test.blade.php b/test.blade.php index 79fce46..d3031d0 100644 --- a/test.blade.php +++ b/test.blade.php @@ -170,12 +170,91 @@ @endforeach -@set($now, new DateTime('now')) -@set('newvar', 'value') {{ $newvar }} +@set('newvar', 'value') +@set($now, new DateTime('now')) +@set('myArr', ['my' => 'arr']) +@set('myArr2', array('my' => 'arr')) + +@unset('newvar') +@unset($newvar) @debug($somearr) +// xdebug_break breakpoints (configurable) to debug compiled views. Sweet? YES! +@breakpoint + +@markdown +# Some markdown code +** with some bold text too ** +@endmarkdown + +@section('content') + @embed('components.panel', ['type' => 'danger', 'items' => ['first', 'second', 'third'] ]) + @section('content') +

Hello World!

+ @stop + @endembed +@stop + +@macrodef('divider', $class = 'divider', $role = 'seperator') + "; ?> +@endmacro + +
+

Title

+ + @macro("divider") + +

Paragraph

+
+ +@embed('blade-ext::dropdown', ['button' => true ]) + @section('label', 'Choose') + @section('items') + @macro('item', 'Action') + @macro('item', 'Another Action') + @macro('item', 'Something else here') + @macro('item', 'Separated link') + @stop +@endembed + + + + + +{{----------------------------------------}} + @can('permission', $entity) You have permission! @endcan