$rootFolder
$rootFolder :mixed|string|null
internal root folder path
$_parent :null|\FAA\Obj\Generic\Template
The parent template
Parent(): \FAA\Obj\Generic\Template|null
Get the parent
When this instance has a parent template, load it and expose it as instance
The parent or, null
Files(string|null $sub_folder = null): array<mixed,\FAA\Obj\Sys\File>|null
List files of template
Function is available for custom templates only
string|null | $sub_folder | A relative sub folder path |
The list of files or, null when not accessible
ToPlainObject(string|null $language = null,boolean $with_parent = true): \stdClass
Convert to stdClass
Makes a plain object from this instance including the values of the index and the text index.
string|null | $language | The target translate language |
boolean | $with_parent | Resolve with parent instance |
The template contents
GetHook(\FAA\Obj\Generic\Folder $tree,\FAA\Obj\Request $request): null|object
Get hook
Get an instance of the registered hook functions or, the parent hook of the template
\FAA\Obj\Generic\Folder | $tree | The called folder |
\FAA\Obj\Request | $request | The request context |
GetCodeFilePath(string $name,string $ext = 'html',integer $depth): string
load template path abstract method to load the path to a file from assigned template object will return null if file not found or template not registered
string | $name | Name of the template file that |
string | $ext | File extension of searched template |
integer | $depth | Recursion depth secure flag |
Absolute path to the template or null if none was found
UpdateFile(string $path,string $file,string $data): \FAA\Obj\Result|null
Update a file Create or update a template file of the template with given data
string | $path | Sub folder of this root folder |
string | $file | The file name |
string | $data | The contents of the new file |
resolveParentStatics(string $parent_source): string
Resolve static includes
Even if this methods was intentionally designed for parent includes it resolves all template statics. It adds relative and absolute include paths for certain includes like css files and images.
On top it enables the support of smarty like include syntax {include file=""} but only for one level depth.
string | $parent_source | The absolute path to template file |
The resolved template data as string