]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/commands/class_BaseCommand.php
Opps, forgot this.
[core.git] / inc / classes / main / commands / class_BaseCommand.php
index 03c715ac770693c635e974867cd1c2a21e191e8a..ac9268197d2795801667a81aeb7814f0082023ec 100644 (file)
@@ -38,9 +38,10 @@ class BaseCommand extends BaseFrameworkSystem {
         *
         * @param       $requestInstance        An instance of a class with an Requestable interface
         * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @param       $suffix                         Optional template suffix, e.g. '_form' for forms
         * @return      void
         */
-       protected function sendGenericGetResponse (Requestable $requestInstance, Responseable $responseInstance) {
+       protected function sendGenericGetResponse (Requestable $requestInstance, Responseable $responseInstance, $suffix = '') {
                // This command doesn't handle any POST requests, so only handle get request
                assert(!$requestInstance->isPostRequestMethod());
 
@@ -53,6 +54,9 @@ class BaseCommand extends BaseFrameworkSystem {
                // Transfer application data
                $templateInstance->assignApplicationData($applicationInstance);
 
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
                // Load the master template
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
 
@@ -71,7 +75,7 @@ class BaseCommand extends BaseFrameworkSystem {
                $templateInstance->assignTemplateWithVariable('footer', 'footer');
 
                // Load the content template
-               $templateInstance->loadCodeTemplate($this->getResolverInstance()->getCommandName());
+               $templateInstance->loadCodeTemplate($this->getResolverInstance()->getCommandName() . $suffix);
 
                // Assign the content template with the master template as a content ... ;)
                $templateInstance->assignTemplateWithVariable($applicationInstance->getAppShortName() . '_' . $this->getResolverInstance()->getCommandName(), 'main_content');