我想使用GLOB从目录中获取所有图像,但我一直收到htmlentities()错误。
htmlentities()期望参数1为字符串,给定数组
我的代码:
查看:
@extends('layouts.templates.master')
@section('content')
<div class="container-fluid">
<div class="row">
<img class="header-image" width="100%" height="200px" src="/assets/events/training.jpg" />
<div class="container">
<h1 class="page-title">FOTO'S</h1>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
@foreach($images as $image)
<h3 style="color: white;font-family:'Michroma',sans-serif;">{{ $image->title }}</h3>
{{{ $fotos = glob($image->img_folder . "/*.jpg") }}}
@foreach( $fotos as $foto )
<a href="{{ $foto }}" class="fullsizable">
<img src="{{ $foto }}">
</a>
@endforeach
@endforeach
</div>
</div>
</div>
</div>
@stop
CONTROLLER
<?php
Class ImagesController extends BaseController
{
public function show($slug)
{
$images = Images::where('slug', '=', $slug)->get();
return View::make('layouts.images.imagegallery')->with('images', $images);
}
public function all(){
$images = Images::orderBy('created_at', 'desc')->paginate(10);
return View::make('layouts.images.imageslist')->with('images', $images);
}
}
这是我的代码,希望你能帮助我