ptest/frm/View.php
2017-01-23 23:33:16 +03:00

41 строка
716 B
PHP

<?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;
}
}