badping_nagios_better/src/core/View.php
2019-11-05 01:14:53 +03:00

45 строки
738 B
PHP

<?php
namespace MyApp\Core;
class View
{
/**
* @var string
*/
public $title = '';
public function json($data)
{
}
public function render($template)
{
/* @var \App $app */
global $app;
$fileName = $app->config->getSrcDir().'/templates/'.$template.'.tpl.php';
if (file_exists($fileName)) {
ob_start();
require $fileName;
ob_end_flush();
}
}
/**
* @param string $title
*
* @return View
*/
public function setTitle(string $title)
{
/* @var \App $app */
global $app;
$this->title = $title.' &mdash; '.$app->config->getSiteName();
return $this;
}
}