Skip to content

Commit

Permalink
Add includeUnless directive (#30538)
Browse files Browse the repository at this point in the history
  • Loading branch information
intrepidws authored and taylorotwell committed Nov 8, 2019
1 parent f6b4d8e commit 60a688a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ protected function compileIncludeWhen($expression)
return "<?php echo \$__env->renderWhen($expression, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>";
}

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

return "<?php echo \$__env->renderWhen(! $expression, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>";
}

/**
* Compile the include-first statements into valid PHP.
*
Expand Down

0 comments on commit 60a688a

Please sign in to comment.