template 엔진 '일단' 추가

This commit is contained in:
2018-01-11 21:40:21 +09:00
parent ee4f524437
commit 3a025cfa70
20 changed files with 1666 additions and 4 deletions
+53
View File
@@ -0,0 +1,53 @@
<?php
namespace League\Plates\Template;
use LogicException;
/**
* Default template directory.
*/
class Directory
{
/**
* Template directory path.
* @var string
*/
protected $path;
/**
* Create new Directory instance.
* @param string $path
*/
public function __construct($path = null)
{
$this->set($path);
}
/**
* Set path to templates directory.
* @param string|null $path Pass null to disable the default directory.
* @return Directory
*/
public function set($path)
{
if (!is_null($path) and !is_dir($path)) {
throw new LogicException(
'The specified path "' . $path . '" does not exist.'
);
}
$this->path = $path;
return $this;
}
/**
* Get path to templates directory.
* @return string
*/
public function get()
{
return $this->path;
}
}