Skip to content

Instantly share code, notes, and snippets.

@troymcginnis
Last active April 30, 2018 21:42
Show Gist options
  • Save troymcginnis/3bfabf043b915c50da11535144aa56ca to your computer and use it in GitHub Desktop.
Save troymcginnis/3bfabf043b915c50da11535144aa56ca to your computer and use it in GitHub Desktop.
{{-- /resources/views/partials/hero.blade.php --}}
<section class="hero">
<div class="hero__images">
<img class="hero__images-back" src="{{ $bg_image }}" />
<img class="hero__images-front" src="{{ $front_image }}" />
</div>
<div class="container">
<h1>{{ $title }}</h1>
<p>{{ $sub_title }}</p>
</div>
</section>
<?php
// /app/controllers/page.php
namespace App;
use Sober\Controller\Controller;
class Page extends Controller
{
public function hero()
{
return [
'bg_image' => get_field('bg_image')['url'],
'front_image' => get_field('front_image')['url'],
'title' => get_field('title'),
'content' => get_field('sub_title'),
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment