first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author jhx
|
||||
* @date 2023/3/1 15:59
|
||||
*/
|
||||
|
||||
namespace utils;
|
||||
|
||||
use think\Template;
|
||||
|
||||
class View
|
||||
{
|
||||
private static $instance;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
// 私有构造方法,防止外部实例化
|
||||
}
|
||||
|
||||
public static function getInstance(): Template
|
||||
{
|
||||
if (null === static::$instance) {
|
||||
static::$instance = new \think\Template(VIEW_CONFIG);
|
||||
}
|
||||
|
||||
return static::$instance;
|
||||
}
|
||||
|
||||
private function __clone()
|
||||
{
|
||||
// 私有克隆方法,防止外部克隆对象
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user