<?php
/**
 * Created by PhpStorm.
 * User: Игорь
 * Date: 23.01.2017
 * Time: 02:45
 */

namespace PFRM;


class View {
  public $app;

  private $view_filename;

  public $site_name;

  function __construct( $filename ) {
    global $app;
    $this->app = $app;
    $this->view_filename = $this->app->config->views_dir . $filename . '.php';
    $this->site_name = $this->app->config->site_name;
  }

  /**
   * Установка HTTP-заголовка
   *
   * @param string $header http-заголовок
   */
  public function setHTTPHeader( $header ) {
    header( $header, 1 );
  }

  /**
   * Запуск php-шаблона
   */
  public function render( ) {
    require $this->view_filename;
  }
}