Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d09bd2836a | ||
|
|
e96bc71eff | ||
|
|
3b4836bb5e | ||
|
|
94ada77e89 |
@@ -59,7 +59,7 @@ class Content implements TemplateInterface {
|
||||
public function addSubtemplate(string $point, string $subtemplate, array $resource = []) : void {
|
||||
if (empty(ContentData::$subtemplatePath))throw new AppError("SubtemplatePath is not defined");
|
||||
if (empty($point)) throw new AppError("Empty point");
|
||||
if (empty($subtemplate) || !file_exists(ContentData::$subtemplatePath.$subtemplate)) throw new AppError(ContentData::$subtemplatePath.$subtemplate. " is not found");
|
||||
if (empty($subtemplate) || !file_exists(ContentData::$subtemplatePath.$subtemplate)) throw new AppError("Subtemplate ".ContentData::$subtemplatePath.$subtemplate. " is not found");
|
||||
foreach ($resource as $resKey => $resVal){
|
||||
$this->{$resKey} = $resVal;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ class Content implements TemplateInterface {
|
||||
foreach ($resource as $resKey => $resVal){
|
||||
$this->{$resKey} = $resVal;
|
||||
}
|
||||
if(empty($incFile) || !file_exists(ContentData::$subtemplatePath.$incFile)) throw new AppError("Empty inc file");
|
||||
if(empty($incFile) || !file_exists(ContentData::$subtemplatePath.$incFile)) throw new AppError("Inc file ".$incFile." is not found");
|
||||
ob_start(); include ContentData::$subtemplatePath.$incFile; $out = ob_get_contents(); ob_end_clean();
|
||||
return $out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user