18 lines
350 B
PHP
18 lines
350 B
PHP
<?php
|
|
namespace Core;
|
|
|
|
class View
|
|
{
|
|
private static $twig = null;
|
|
|
|
public static function render($template, $args = [])
|
|
{
|
|
if (self::$twig === null) {
|
|
$loader = new \Twig_Loader_Filesystem('App/Views');
|
|
$twig = new \Twig_Environment($loader);
|
|
}
|
|
|
|
echo $twig->render($template, $args);
|
|
}
|
|
}
|