Last active
August 21, 2017 20:16
-
-
Save ekandreas/d6b40dd790d658c1aaaf5ddd59540ff6 to your computer and use it in GitHub Desktop.
Bladerunner 1.7 Controllers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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