1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,116 +0,0 @@ |
1 |
-<?php |
|
2 |
- |
|
3 |
-namespace Illuminate\View\Compilers\Concerns; |
|
4 |
- |
|
5 |
-use Illuminate\View\Factory as ViewFactory; |
|
6 |
- |
|
7 |
-trait CompilesLayouts |
|
8 |
-{ |
|
9 |
- /** |
|
10 |
- * The name of the last section that was started. |
|
11 |
- * |
|
12 |
- * @var string |
|
13 |
- */ |
|
14 |
- protected $lastSection; |
|
15 |
- |
|
16 |
- /** |
|
17 |
- * Compile the extends statements into valid PHP. |
|
18 |
- * |
|
19 |
- * @param string $expression |
|
20 |
- * @return string |
|
21 |
- */ |
|
22 |
- protected function compileExtends($expression) |
|
23 |
- { |
|
24 |
- $expression = $this->stripParentheses($expression); |
|
25 |
- |
|
26 |
- $echo = "<?php echo \$__env->make({$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>"; |
|
27 |
- |
|
28 |
- $this->footer[] = $echo; |
|
29 |
- |
|
30 |
- return ''; |
|
31 |
- } |
|
32 |
- |
|
33 |
- /** |
|
34 |
- * Compile the section statements into valid PHP. |
|
35 |
- * |
|
36 |
- * @param string $expression |
|
37 |
- * @return string |
|
38 |
- */ |
|
39 |
- protected function compileSection($expression) |
|
40 |
- { |
|
41 |
- $this->lastSection = trim($expression, "()'\" "); |
|
42 |
- |
|
43 |
- return "<?php \$__env->startSection{$expression}; ?>"; |
|
44 |
- } |
|
45 |
- |
|
46 |
- /** |
|
47 |
- * Replace the @parent directive to a placeholder. |
|
48 |
- * |
|
49 |
- * @return string |
|
50 |
- */ |
|
51 |
- protected function compileParent() |
|
52 |
- { |
|
53 |
- return ViewFactory::parentPlaceholder($this->lastSection ?: ''); |
|
54 |
- } |
|
55 |
- |
|
56 |
- /** |
|
57 |
- * Compile the yield statements into valid PHP. |
|
58 |
- * |
|
59 |
- * @param string $expression |
|
60 |
- * @return string |
|
61 |
- */ |
|
62 |
- protected function compileYield($expression) |
|
63 |
- { |
|
64 |
- return "<?php echo \$__env->yieldContent{$expression}; ?>"; |
|
65 |
- } |
|
66 |
- |
|
67 |
- /** |
|
68 |
- * Compile the show statements into valid PHP. |
|
69 |
- * |
|
70 |
- * @return string |
|
71 |
- */ |
|
72 |
- protected function compileShow() |
|
73 |
- { |
|
74 |
- return '<?php echo $__env->yieldSection(); ?>'; |
|
75 |
- } |
|
76 |
- |
|
77 |
- /** |
|
78 |
- * Compile the append statements into valid PHP. |
|
79 |
- * |
|
80 |
- * @return string |
|
81 |
- */ |
|
82 |
- protected function compileAppend() |
|
83 |
- { |
|
84 |
- return '<?php $__env->appendSection(); ?>'; |
|
85 |
- } |
|
86 |
- |
|
87 |
- /** |
|
88 |
- * Compile the overwrite statements into valid PHP. |
|
89 |
- * |
|
90 |
- * @return string |
|
91 |
- */ |
|
92 |
- protected function compileOverwrite() |
|
93 |
- { |
|
94 |
- return '<?php $__env->stopSection(true); ?>'; |
|
95 |
- } |
|
96 |
- |
|
97 |
- /** |
|
98 |
- * Compile the stop statements into valid PHP. |
|
99 |
- * |
|
100 |
- * @return string |
|
101 |
- */ |
|
102 |
- protected function compileStop() |
|
103 |
- { |
|
104 |
- return '<?php $__env->stopSection(); ?>'; |
|
105 |
- } |
|
106 |
- |
|
107 |
- /** |
|
108 |
- * Compile the end-section statements into valid PHP. |
|
109 |
- * |
|
110 |
- * @return string |
|
111 |
- */ |
|
112 |
- protected function compileEndsection() |
|
113 |
- { |
|
114 |
- return '<?php $__env->stopSection(); ?>'; |
|
115 |
- } |
|
116 |
-} |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,116 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+namespace Illuminate\View\Compilers\Concerns; |
|
4 |
+ |
|
5 |
+use Illuminate\View\Factory as ViewFactory; |
|
6 |
+ |
|
7 |
+trait CompilesLayouts |
|
8 |
+{ |
|
9 |
+ /** |
|
10 |
+ * The name of the last section that was started. |
|
11 |
+ * |
|
12 |
+ * @var string |
|
13 |
+ */ |
|
14 |
+ protected $lastSection; |
|
15 |
+ |
|
16 |
+ /** |
|
17 |
+ * Compile the extends statements into valid PHP. |
|
18 |
+ * |
|
19 |
+ * @param string $expression |
|
20 |
+ * @return string |
|
21 |
+ */ |
|
22 |
+ protected function compileExtends($expression) |
|
23 |
+ { |
|
24 |
+ $expression = $this->stripParentheses($expression); |
|
25 |
+ |
|
26 |
+ $echo = "<?php echo \$__env->make({$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>"; |
|
27 |
+ |
|
28 |
+ $this->footer[] = $echo; |
|
29 |
+ |
|
30 |
+ return ''; |
|
31 |
+ } |
|
32 |
+ |
|
33 |
+ /** |
|
34 |
+ * Compile the section statements into valid PHP. |
|
35 |
+ * |
|
36 |
+ * @param string $expression |
|
37 |
+ * @return string |
|
38 |
+ */ |
|
39 |
+ protected function compileSection($expression) |
|
40 |
+ { |
|
41 |
+ $this->lastSection = trim($expression, "()'\" "); |
|
42 |
+ |
|
43 |
+ return "<?php \$__env->startSection{$expression}; ?>"; |
|
44 |
+ } |
|
45 |
+ |
|
46 |
+ /** |
|
47 |
+ * Replace the @parent directive to a placeholder. |
|
48 |
+ * |
|
49 |
+ * @return string |
|
50 |
+ */ |
|
51 |
+ protected function compileParent() |
|
52 |
+ { |
|
53 |
+ return ViewFactory::parentPlaceholder($this->lastSection ?: ''); |
|
54 |
+ } |
|
55 |
+ |
|
56 |
+ /** |
|
57 |
+ * Compile the yield statements into valid PHP. |
|
58 |
+ * |
|
59 |
+ * @param string $expression |
|
60 |
+ * @return string |
|
61 |
+ */ |
|
62 |
+ protected function compileYield($expression) |
|
63 |
+ { |
|
64 |
+ return "<?php echo \$__env->yieldContent{$expression}; ?>"; |
|
65 |
+ } |
|
66 |
+ |
|
67 |
+ /** |
|
68 |
+ * Compile the show statements into valid PHP. |
|
69 |
+ * |
|
70 |
+ * @return string |
|
71 |
+ */ |
|
72 |
+ protected function compileShow() |
|
73 |
+ { |
|
74 |
+ return '<?php echo $__env->yieldSection(); ?>'; |
|
75 |
+ } |
|
76 |
+ |
|
77 |
+ /** |
|
78 |
+ * Compile the append statements into valid PHP. |
|
79 |
+ * |
|
80 |
+ * @return string |
|
81 |
+ */ |
|
82 |
+ protected function compileAppend() |
|
83 |
+ { |
|
84 |
+ return '<?php $__env->appendSection(); ?>'; |
|
85 |
+ } |
|
86 |
+ |
|
87 |
+ /** |
|
88 |
+ * Compile the overwrite statements into valid PHP. |
|
89 |
+ * |
|
90 |
+ * @return string |
|
91 |
+ */ |
|
92 |
+ protected function compileOverwrite() |
|
93 |
+ { |
|
94 |
+ return '<?php $__env->stopSection(true); ?>'; |
|
95 |
+ } |
|
96 |
+ |
|
97 |
+ /** |
|
98 |
+ * Compile the stop statements into valid PHP. |
|
99 |
+ * |
|
100 |
+ * @return string |
|
101 |
+ */ |
|
102 |
+ protected function compileStop() |
|
103 |
+ { |
|
104 |
+ return '<?php $__env->stopSection(); ?>'; |
|
105 |
+ } |
|
106 |
+ |
|
107 |
+ /** |
|
108 |
+ * Compile the end-section statements into valid PHP. |
|
109 |
+ * |
|
110 |
+ * @return string |
|
111 |
+ */ |
|
112 |
+ protected function compileEndsection() |
|
113 |
+ { |
|
114 |
+ return '<?php $__env->stopSection(); ?>'; |
|
115 |
+ } |
|
116 |
+} |