Merge remote branch 'kriswallsmith/assetic/controller-fix'

* kriswallsmith/assetic/controller-fix:
  [AsseticBundle] fixed controller
This commit is contained in:
Fabien Potencier 2011-04-22 08:40:01 +02:00
commit 2c939e4124

View File

@ -83,12 +83,13 @@ class AsseticController
return new AssetCache($asset, $this->cache); return new AssetCache($asset, $this->cache);
} }
private function findAssetLeaf(AssetInterface $asset, $pos) private function findAssetLeaf(\Traversable $asset, $pos)
{ {
$leaves = array_values(iterator_to_array($asset)); $i = 0;
foreach ($asset as $leaf) {
if (isset($leaves[$pos])) { if ($pos == $i++) {
return $leaves[$pos]; return $leaf;
}
} }
} }
} }