Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 175948b

Browse files
committed
Fix section endings.
1 parent 5e58d28 commit 175948b

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/Illuminate/View/Compilers/BladeCompiler.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,17 @@ protected function compileAppend($expression)
272272
return "<?php \$__env->appendSection(); ?>";
273273
}
274274

275+
/**
276+
* Compile the end-section statements into valid PHP.
277+
*
278+
* @param string $expression
279+
* @return string
280+
*/
281+
protected function compileEndsection($expression)
282+
{
283+
return "<?php \$__env->stopSection(); ?>";
284+
}
285+
275286
/**
276287
* Compile the stop statements into valid PHP.
277288
*

tests/View/ViewBladeCompilerTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,13 @@ public function testStopSectionsAreCompiled()
295295
}
296296

297297

298+
public function testEndSectionsAreCompiled()
299+
{
300+
$compiler = new BladeCompiler($this->getFiles(), __DIR__);
301+
$this->assertEquals('<?php $__env->stopSection(); ?>', $compiler->compileString('@endsection'));
302+
}
303+
304+
298305
public function testAppendSectionsAreCompiled()
299306
{
300307
$compiler = new BladeCompiler($this->getFiles(), __DIR__);

0 commit comments

Comments
 (0)