} // END - if
// Initialize the template engine
- $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class', array($applicationInstance));
+ $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class');
// Return the prepared instance
return $templateInstance;
*/
public function renderMenu () {
// Initialize the menu system by preparing it's template instance
- $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this->getApplicationInstance(), $this));
+ $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this));
// Set it for later use
$this->setTemplateInstance($templateInstance);
/**
* Creates an instance of the class TemplateEngine and prepares it for usage
*
- * @param $applicationInstance A manageable application
* @return $templateInstance An instance of TemplateEngine
* @throws BasePathIsEmptyException If the provided $templateBasePath is empty
* @throws InvalidBasePathStringException If $templateBasePath is no string
* @throws BasePathReadProtectedException If $templateBasePath is
* read-protected
*/
- public static final function createConsoleTemplateEngine (ManageableApplication $applicationInstance) {
+ public static final function createConsoleTemplateEngine () {
// Get a new instance
$templateInstance = new ConsoleTemplateEngine();
+ // Get the application instance from registry
+ $applicationInstance = Registry::getRegistry()->getInstance('app');
+
// Determine base path
$templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
/**
* Creates an instance of the class TemplateEngine and prepares it for usage
*
- * @param $applicationInstance A manageable application
* @return $templateInstance An instance of TemplateEngine
* @throws BasePathIsEmptyException If the provided $templateBasePath is empty
* @throws InvalidBasePathStringException If $templateBasePath is no string
* @throws BasePathReadProtectedException If $templateBasePath is
* read-protected
*/
- public static final function createImageTemplateEngine (ManageableApplication $applicationInstance) {
+ public static final function createImageTemplateEngine () {
// Get a new instance
$templateInstance = new ImageTemplateEngine();
+ // Get the application instance from registry
+ $applicationInstance = Registry::getRegistry()->getInstance('app');
+
// Determine base path
$templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
/**
* Creates an instance of the class TemplateEngine and prepares it for usage
*
- * @param $applicationInstance A manageable application
* @return $templateInstance An instance of TemplateEngine
* @throws BasePathIsEmptyException If the provided $templateBasePath is empty
* @throws InvalidBasePathStringException If $templateBasePath is no string
* @throws BasePathReadProtectedException If $templateBasePath is
* read-protected
*/
- public static final function createMailTemplateEngine (ManageableApplication $applicationInstance) {
+ public static final function createMailTemplateEngine () {
// Get a new instance
$templateInstance = new MailTemplateEngine();
+ // Get the application instance from registry
+ $applicationInstance = Registry::getRegistry()->getInstance('app');
+
// Determine base path
$templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
/**
* Creates an instance of the class TemplateEngine and prepares it for usage
*
- * @param $applicationInstance A manageable application
* @param $menuInstance A RenderableMenu instance
* @return $templateInstance An instance of TemplateEngine
* @throws BasePathIsEmptyException If the provided $templateBasePath is empty
* @throws BasePathReadProtectedException If $templateBasePath is
* read-protected
*/
- public static final function createMenuTemplateEngine (ManageableApplication $applicationInstance, RenderableMenu $menuInstance) {
+ public static final function createMenuTemplateEngine (RenderableMenu $menuInstance) {
// Get a new instance
$templateInstance = new MenuTemplateEngine();
+ // Get the application instance from registry
+ $applicationInstance = Registry::getRegistry()->getInstance('app');
+
// Determine base path
$templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
// Is the template dependency set?
if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
// Get a temporay menu template instance
- $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this->getApplicationInstance(), $this->getMenuInstance()));
+ $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this->getMenuInstance()));
// Then load it
$templateInstance->loadMenuTemplate($templateDependency);
/**
* Creates an instance of the class TemplateEngine and prepares it for usage
*
- * @param $applicationInstance A manageable application
* @return $templateInstance An instance of TemplateEngine
* @throws BasePathIsEmptyException If the provided $templateBasePath is empty
* @throws InvalidBasePathStringException If $templateBasePath is no string
* @throws BasePathReadProtectedException If $templateBasePath is
* read-protected
*/
- public static final function createWebTemplateEngine (ManageableApplication $applicationInstance) {
+ public static final function createWebTemplateEngine () {
// Get a new instance
$templateInstance = new WebTemplateEngine();
+ // Get the application instance from registry
+ $applicationInstance = Registry::getRegistry()->getInstance('app');
+
// Determine base path
$templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';