<?php

namespace Fab\Plugin\Helper;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Trait for template helper
 *
 * @package    Fab
 * @subpackage Fab\Includes
 */
trait Template {

    /**
     * Get template from /templates/$name.json
     *
     * @param string $name Template name.
     * @return object
     */
    public function get_template( $name ) {
        $template = \FAB()->Helper->get_file_content( 'templates/' . $name . '.json' );
        return json_decode( $template );
    }
}
