This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathblade.php
62 lines (54 loc) · 1.81 KB
/
blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/** @var \Illuminate\View\Compilers\BladeCompiler $bladeCompiler */
/*
|-------------------------------------------------------------------------------
| BladeCompiler http://jigsaw.tighten.co/docs/content-blade/
|-------------------------------------------------------------------------------
|
| Here is where you can register Blade components, directives, and includes,
| so that you can reference them easier in your templates.
|
*/
/*
|-------------------------------------------------------------------------------
| @env
|-------------------------------------------------------------------------------
|
| Blade "if" directive that checks the current NODE_ENV. Use it to output
| content only when building for a certain environment. Note that the
| parameter must match the NODE_ENV as defined in package.json.
|
| Example:
|
| @env('development')
| Show this if we do `npm run dev` or `npm run watch`
| @elseenv('production')
| But when we do `npm run prod`, show this instead
| @endenv
|
*/
$bladeCompiler->directive('env', function ($env) {
return "<?php if (getenv('NODE_ENV') == $env): ?>";
});
$bladeCompiler->directive('elseenv', function ($env) {
return "<?php elseif (getenv('NODE_ENV') == $env): ?>";
});
$bladeCompiler->directive('endenv', function () {
return '<?php endif; ?>';
});
/*
|-------------------------------------------------------------------------------
| @vmlbg
|-------------------------------------------------------------------------------
|
| Outlook VML background image component, that uses <v:image> to enable
| Windows 10 Mail support as well.
|
| Usage:
|
| @vmlbg(['src' => 'http://url.to/image.jpg', 'width' => 600, 'height' => 400])
... your HTML to be overlayed on top of the image
| @endvmlbg
|
*/
$bladeCompiler->component('_components.vmlbg');