Skip to content

Commit

Permalink
extendsFirst method the same way as the includesFirst (#34648)
Browse files Browse the repository at this point in the history
  • Loading branch information
horphoz authored Oct 5, 2020
1 parent 45ccee4 commit 9f0bb04
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Illuminate/View/Compilers/Concerns/CompilesLayouts.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ protected function compileExtends($expression)

return '';
}

/**
* Compile the extends-first statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileExtendsFirst($expression)
{
$expression = $this->stripParentheses($expression);

$echo = "<?php echo \$__env->first({$expression}, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>";

$this->footer[] = $echo;

return '';
}

/**
* Compile the section statements into valid PHP.
Expand Down

0 comments on commit 9f0bb04

Please sign in to comment.