<?php
class PageFmHome extends CDController{

  public function __construct() {
    $this->view = 'fm/page/home.twig';
  }

  public function get_context(){

    $this->data = CDTimber::get_context();

    $this->data['last_magazine'] = cw_get_last_magazine();

    $args = array(
      'post_type' => 'fm_magazine',
      'posts_per_page' => -1,
      'post_parent' => $this->data['last_magazine']->ID
    );


    $this->data['last_magazine_posts'] = Timber::get_posts($args);

  }

}
