Fix
This commit is contained in:
parent
61bc60a948
commit
26e9002369
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Krutush\\Template": "src/"
|
||||
"Krutush\\Template\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,6 +4,9 @@ namespace Krutush\Template;
|
|||
|
||||
class Html extends Text{
|
||||
|
||||
/** @var string */
|
||||
const EXTENTION = '.phtml';
|
||||
|
||||
public function _escape(string $data){
|
||||
return htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ class Template{
|
|||
/** @var array */
|
||||
private $data = array();
|
||||
/** @var string */
|
||||
private $extention = '.tpl';
|
||||
const EXTENTION = '.tpl';
|
||||
|
||||
public function __construct(string $path, string $extention = null, bool $folder = true){
|
||||
$this->path = $this->path($path, $extention, $folder);
|
||||
|
@ -77,7 +77,7 @@ class Template{
|
|||
}
|
||||
|
||||
public function path(string $path, string $extention = null, bool $folder = true): string{
|
||||
$path .= $extention ?? $this->extention;
|
||||
$path .= $extention ?? self::EXTENTION;
|
||||
if($folder == true && class_exists(\Krutush\Path)) //Remove require krutush/krutush
|
||||
$path = \Krutush\Path::get('template').'/'.$path;
|
||||
|
||||
|
|
Loading…
Reference in New Issue