Skip to content

Instantly share code, notes, and snippets.

@filp
Created March 20, 2013 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filp/5207588 to your computer and use it in GitHub Desktop.
Save filp/5207588 to your computer and use it in GitHub Desktop.
Blade blows up when iterating an empty array, and for example calling a method on the placeholder variable
<?php
/**
* Controller:
*/
return View::make('foo', array( 'test' => array() ))
/**
* foo.blade.php
*/
@foreach($test as $t)
$t->someMethod()
@endforeach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment