Laravel自定义模型中的新RecursiveIteratorIterator

时间:2014-05-04 16:05:59

标签: recursion model laravel-4

我尝试在我的laravel模型方法中调用PHP' s RecursiveIteratorIterator如下

$columns = new RecursiveIteratorIterator(new RecursiveArrayIterator($feeds));

但我得到

Class 'App\Models\RecursiveIteratorIterator' not found 

如何在我的模型中包含通常应该可访问的

找到它

use \RecursiveIteratorIterator;
use \RecursiveArrayIterator;

1 个答案:

答案 0 :(得分:-1)

试试这个例子:

foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($PATH)) as $filename) {
    echo $filename."<br>";
}