Skip to content

Instantly share code, notes, and snippets.

@ekandreas
Last active August 21, 2017 20:16
Show Gist options
  • Save ekandreas/d6b40dd790d658c1aaaf5ddd59540ff6 to your computer and use it in GitHub Desktop.
Save ekandreas/d6b40dd790d658c1aaaf5ddd59540ff6 to your computer and use it in GitHub Desktop.
Bladerunner 1.7 Controllers
<?php
// file: controllers/single.php
namespace App;
use Bladerunner\Controller;
class Single extends Controller
{
/**
* Return images from Advanced Custom Fields
*
* @return array
*/
public function images()
{
return get_field('images');
}
}
<!-- file: views/single.blade.php -->
@if($images)
<ul>
@foreach($images as $image)
<li><img src="{{$image['sizes']['thumbnail']}}" alt="{{$image['alt']}}"></li>
@endforeach
</ul>
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment