Commit 992a5f74 authored by Dayle Rees's avatar Dayle Rees

fix for forelse only matching $vars

Signed-off-by: 's avatarDayle Rees <thepunkfan@gmail.com>
parent 34919aff
......@@ -213,12 +213,12 @@ class Blade {
foreach ($matches[0] as $forelse)
{
preg_match('/\$[^\s]*/', $forelse, $variable);
preg_match('/\s*\(\s*(\S*)\s/', $forelse, $variable);
// Once we have extracted the variable being looped against, we can add
// an if statement to the start of the loop that checks if the count
// of the variable being looped against is greater than zero.
$if = "<?php if (count({$variable[0]}) > 0): ?>";
$if = "<?php if (count({$variable[1]}) > 0): ?>";
$search = '/(\s*)@forelse(\s*\(.*\))/';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment