]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/commands/html/class_HtmlRegisterCommand.php
Continued:
[core.git] / framework / main / classes / commands / html / class_HtmlRegisterCommand.php
index 619bfabfcca889908dacefc6600061686ba6d132..3a223a7db1270a85ed3ff7921c3e9189f48f565b 100644 (file)
@@ -76,44 +76,41 @@ class HtmlRegisterCommand extends BaseCommand implements Commandable {
                // Get the application instance
                $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
 
-               // Prepare a template instance
-               $templateInstance = $this->prepareTemplateInstance($applicationInstance);
-
                // Assign all the application's data with template variables
-               $templateInstance->assignApplicationData();
+               $this->getTemplateInstance()->assignApplicationData();
 
                // Assign base URL
-               $templateInstance->assignConfigVariable('base_url');
+               $this->getTemplateInstance()->assignConfigVariable('base_url');
 
                // Load the master template
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
 
                // Load header template
-               $templateInstance->loadCodeTemplate('header');
+               $this->getTemplateInstance()->loadCodeTemplate('header');
 
                // Compile and assign it with a variable
-               $templateInstance->compileTemplate();
-               $templateInstance->assignTemplateWithVariable('header', 'header');
+               $this->getTemplateInstance()->compileTemplate();
+               $this->getTemplateInstance()->assignTemplateWithVariable('header', 'header');
 
                // Load footer template
-               $templateInstance->loadCodeTemplate('footer');
+               $this->getTemplateInstance()->loadCodeTemplate('footer');
 
                // Compile and assign it with a variable
-               $templateInstance->compileTemplate();
-               $templateInstance->assignTemplateWithVariable('footer', 'footer');
+               $this->getTemplateInstance()->compileTemplate();
+               $this->getTemplateInstance()->assignTemplateWithVariable('footer', 'footer');
 
                // Load the register template
-               $templateInstance->loadCodeTemplate('register_form');
+               $this->getTemplateInstance()->loadCodeTemplate('register_form');
 
                // Assign the register template with the master template as a content ... ;)
-               $templateInstance->compileTemplate();
-               $templateInstance->assignTemplateWithVariable('register_form', 'main_content');
+               $this->getTemplateInstance()->compileTemplate();
+               $this->getTemplateInstance()->assignTemplateWithVariable('register_form', 'main_content');
 
                // Load the master template
-               $templateInstance->loadCodeTemplate($masterTemplate);
+               $this->getTemplateInstance()->loadCodeTemplate($masterTemplate);
 
                // Set title
-               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_register_title'));
+               $this->getTemplateInstance()->assignVariable('title', $this->getLanguageInstance()->getMessage('page_register_title'));
 
                // Construct the menu in every command. We could do this in BaseCommand class. But this means
                // *every* command has a navigation system and that is want we don't want.
@@ -123,17 +120,17 @@ class HtmlRegisterCommand extends BaseCommand implements Commandable {
                $menuInstance->renderMenu();
 
                // Transfer it to the template engine instance
-               $menuInstance->transferContentToTemplateEngine($templateInstance);
+               $menuInstance->transferContentToTemplateEngine($this->getTemplateInstance());
 
                /*
                 * ... and all variables. This should be merged together in a pattern
                 * to make things easier. A cache mechanism should be added between
                 * these two calls to cache compiled templates.
                 */
-               $templateInstance->compileVariables();
+               $this->getTemplateInstance()->compileVariables();
 
                // Get the content back from the template engine and put it in response class
-               $templateInstance->transferToResponse($responseInstance);
+               $this->getTemplateInstance()->transferToResponse($responseInstance);
        }
 
        /**