X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Ftemplate%2Fclass_TemplateEngine.php;h=7fada106d4501510690254e537f3d9fb6742a4ef;hp=fad4cf4a3f5a956a63092319b477076d58f0586b;hb=9327c11e14407cce78208de01b5cdd2de87e13a3;hpb=8f6f9ab77c4c9820656ffa8ecd01bc3e68f1ca95;ds=sidebyside diff --git a/inc/classes/main/template/class_TemplateEngine.php b/inc/classes/main/template/class_TemplateEngine.php index fad4cf4..7fada10 100644 --- a/inc/classes/main/template/class_TemplateEngine.php +++ b/inc/classes/main/template/class_TemplateEngine.php @@ -283,6 +283,53 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate } } + /** + * Setter for template type. Only "html", "emails" and "compiled" should + * be sent here + * + * @param $templateType The current template's type + * @return void + */ + private final function setTemplateType ($templateType) { + // Cast it + $templateType = (string) $templateType; + + // And set it (only 2 letters) + $this->templateType = $templateType; + } + + /** + * Setter for the last loaded template's FQFN + * + * @param $template The last loaded template + * @return void + */ + private final function setLastTemplate ($template) { + // Cast it to string + $template = (string) $template; + $this->lastTemplate = $template; + } + + /** + * Getter for the last loaded template's FQFN + * + * @return $template The last loaded template + */ + private final function getLastTemplate () { + return $this->lastTemplate; + } + + /** + * Assign a given congfiguration variable with a value + * + * @param $var The configuration variable we want to assign + * @return void + */ + private final function assignConfigVariable ($var) { + // Sweet and simple... + $this->configVariables[$var] = $this->getConfigInstance()->readConfig($var); + } + /** * Initialize the variable stack. This holds all variables for later * compilation. @@ -372,8 +419,8 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * Setter for path of compiled templates * - * @param $compileOutputPath The local base path for all - * compiled templates + * @param $compileOutputPath The local base path for all compiled + * templates * @return void */ public final function setCompileOutputPath ($compileOutputPath) { @@ -384,21 +431,6 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate $this->compileOutputPath = $compileOutputPath; } - /** - * Setter for template type. Only "html", "emails" and "compiled" should - * be sent here - * - * @param $templateType The current template's type - * @return void - */ - private final function setTemplateType ($templateType) { - // Cast it - $templateType = (string) $templateType; - - // And set it (only 2 letters) - $this->templateType = $templateType; - } - /** * Getter for template type * @@ -408,32 +440,11 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate return $this->templateType; } - /** - * Setter for the last loaded template's FQFN - * - * @param $template The last loaded template - * @return void - */ - private final function setLastTemplate ($template) { - // Cast it to string - $template = (string) $template; - $this->lastTemplate = $template; - } - - /** - * Getter for the last loaded template's FQFN - * - * @return $template The last loaded template - */ - private final function getLastTemplate () { - return $this->lastTemplate; - } - /** * Assign (add) a given variable with a value * - * @param $var The variable we are looking for - * @param $value The value we want to store in the variable + * @param $var The variable we are looking for + * @param $value The value we want to store in the variable * @return void */ public final function assignVariable ($var, $value) { @@ -450,22 +461,10 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate } } - /** - * Assign a given congfiguration variable with a value - * - * @param $var The configuration variable we are looking for - * @param $value The value we want to store in the variable - * @return void - */ - public final function assignConfigVariable ($var, $value) { - // Sweet and simple... - $this->configVariables[$var] = $value; - } - /** * Removes a given variable * - * @param $var The variable we are looking for + * @param $var The variable we are looking for * @return void */ public final function removeVariable ($var) { @@ -482,7 +481,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * Private setter for raw template data * - * @param $rawTemplateData The raw data from the template + * @param $rawTemplateData The raw data from the template * @return void */ private final function setRawTemplateData ($rawTemplateData) { @@ -495,6 +494,8 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * Private setter for compiled templates + * + * @return void */ private final function setCompiledData ($compiledData) { // Cast it to string @@ -507,7 +508,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * Private loader for all template types * - * @param $template The template we shall load + * @param $template The template we shall load * @return void */ private final function loadTemplate ($template) { @@ -539,12 +540,12 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * A private loader for raw template names * - * @param $fqfn The full-qualified file name for a template + * @param $fqfn The full-qualified file name for a template * @return void * @throws NullPointerException If $inputInstance is null * @throws NoObjectException If $inputInstance is not an object * @throws MissingMethodException If $inputInstance is missing a - * required method + * required method */ private function loadRawTemplateData ($fqfn) { // Get a input/output instance from the middleware @@ -576,9 +577,9 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate * Try to assign an extracted template variable as a "content" or "config" * variable. * - * @param $varName The variable's name (shall be content or - * config) by default - * @param $var The variable we want to assign + * @param $varName The variable's name (shall be content orconfig) by + * default + * @param $var The variable we want to assign */ private function assignTemplateVariable ($varName, $var) { // Is it not a config variable? @@ -587,7 +588,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate $this->assignVariable($var, ""); } else { // Configuration variables - $this->assignConfigVariable($var, $this->getConfigInstance()->readConfig($var)); + $this->assignConfigVariable($var); } } @@ -617,7 +618,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * Main analysis of the loaded template * - * @param $templateMatches Found template place-holders, see below + * @param $templateMatches Found template place-holders, see below * @return void * *--------------------------------- @@ -676,8 +677,8 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate /** * Compile a given raw template code and remember it for later usage * - * @param $code The raw template code - * @param $template The template's name + * @param $code The raw template code + * @param $template The template's name * @return void */ private function compileCode ($code, $template) { @@ -712,7 +713,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate * Insert all given and loaded templates by running through all loaded * codes and searching for their place-holder in the main template * - * @param $templateMatches See method analyzeTemplate() + * @param $templateMatches See method analyzeTemplate() * @return void */ private function insertAllTemplates (array $templateMatches) {