/**
* The own template engine for loading caching and sending out the web pages
* and emails.
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0
+ * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate {
/**
* E.g.: {?template:variable=value;var2=value2;[...]?}
*/
private $regExpCodeTags = '/\{\?([a-z_]+)(:("[^"]+"|[^?}]+)+)?\?\}/';
-
+
// Exception codes for the template engine
const EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED = 0xa00;
const TEMPLATE_CONTAINS_INVALID_VAR_EXCEPTION = 0xa01;
public final function initVariableStack () {
$this->varStack = new FrameworkArrayObject();
}
-
+
/**
* Setter for language instance which should be LanguageSystem
*
public final function setLanguageInstance (ManageableLanguage $langInstance) {
$this->langInstance = $langInstance;
}
-
+
/**
* Setter for file I/O instance which should be FileIOHandler
*
public final function setIOInstance (FileIOHandler $ioInstance) {
$this->ioInstance = $ioInstance;
}
-
+
/**
* Getter for file I/O instance which should be FileIOHandler
*
public final function getTemplateType () {
return $this->templateType;
}
-
+
/**
* Setter for the last loaded template's FQFN
*
$template = (string) $template;
$this->lastTemplate = $template;
}
-
+
/**
* Getter for the last loaded template's FQFN
*
private final function getLastTemplate () {
return $this->lastTemplate;
}
-
+
/**
* Assign (add) a given variable with a value
*
$this->modifyVariable($var, $value);
}
}
-
+
/**
* Assign a given congfiguration variable with a value
*
// Sweet and simple...
$this->configVariables[$var] = $value;
}
-
+
/**
* Removes a given variable
*
// Run the constructed command. This will "compile" all variables in
eval($eval);
}
-
+
/**
* Compile all required templates into the current loaded one
*