Timecard/provide/classes/Template.php

30 lines
452 B
PHP
Raw Permalink Normal View History

2022-05-22 15:22:49 +09:00
<?php
/***
* Copyright (c) 2022 DevRas
*
*/
class Template
{
public function __construct($root)
{
$this->root = $root;
}
protected $root;
public function viewModel($model, $args = [])
{
$args["__LOADER__"] = $this;
$path = $this->root . DIRECTORY_SEPARATOR . $model . ".php";
if (!file_exists($path))
{
return false;
}
return @include $path;
}
}