Skip to content

Commit 5538ba1

Browse files
committed
Add Components and Slots directives
1 parent 1379e8c commit 5538ba1

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

blade.sublime-syntax

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ contexts:
7878
0: punctuation.section.embedded.end.php
7979
pop: true
8080

81-
- 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|cannot|inject|partial|hasSection|elsecan|elsecannot|stack|push|layout|continue|break|minify|macro|servers|task|hipchat|slack|story|wpposts|acfrepeater)\b(?=(|\s*|)\()'
81+
- 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|cannot|inject|partial|hasSection|elsecan|elsecannot|stack|push|layout|continue|break|minify|macro|servers|task|hipchat|slack|story|wpposts|acfrepeater|component|slot)\b(?=(|\s*|)\()'
8282
captures:
8383
0: punctuation.section.embedded.php
8484
2: constant.other.inline-data.html
@@ -90,7 +90,7 @@ contexts:
9090
pop: true
9191
- include: 'scope:source.php'
9292

93-
- 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|endcannot|append|endpush|markdown|endmarkdown|endminify|endtask|setup|after|endsetup|endafter|endstory|wpquery|wpempty|wpend|acfend)\b'
93+
- 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|endcannot|append|endpush|markdown|endmarkdown|endminify|endtask|setup|after|endsetup|endafter|endstory|wpquery|wpempty|wpend|acfend|endcomponent|endslot)\b'
9494
scope: custom.compiler.blade.php
9595
captures:
9696
0: punctuation.section.embedded.php

packages.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
{
2727
"sublime_text": ">3084",
2828
"platforms": ["windows", "osx", "linux"],
29-
"version": "1.6.2",
30-
"url": "https://nodeload.github.com/Medalink/laravel-blade/zip/1.6.2",
31-
"date": "2016-10-01 09:35:00"
29+
"version": "1.6.3",
30+
"url": "https://nodeload.github.com/Medalink/laravel-blade/zip/1.6.3",
31+
"date": "2016-11-16 09:35:00"
3232
}
3333
]
3434
}

test.blade

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,21 @@ This comment will not be in the rendered HTML
333333
git
334334
composer install
335335
@endstory
336+
337+
@component('layouts.app')
338+
@slot('title')
339+
Home Page
340+
@endslot
341+
342+
<div class="col-6">
343+
@component('inc.alert')
344+
This is the alert message here.
345+
@endcomponent
346+
<h1>Welcome</h1>
347+
</div>
348+
<div class="col-6">
349+
@component('inc.sidebar')
350+
This is my sidebar text.
351+
@endcomponent
352+
</div>
353+
@endcomponent

test.blade.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,21 @@
333333
git
334334
composer install
335335
@endstory
336+
337+
@component('layouts.app')
338+
@slot('title')
339+
Home Page
340+
@endslot
341+
342+
<div class="col-6">
343+
@component('inc.alert')
344+
This is the alert message here.
345+
@endcomponent
346+
<h1>Welcome</h1>
347+
</div>
348+
<div class="col-6">
349+
@component('inc.sidebar')
350+
This is my sidebar text.
351+
@endcomponent
352+
</div>
353+
@endcomponent

0 commit comments

Comments
 (0)