]> git.mxchange.org Git - core.git/commitdiff
Added support for template suffix. This allows to load templates such as register_for...
authorRoland Haeder <roland@mxchange.org>
Mon, 6 Apr 2015 22:16:11 +0000 (00:16 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 6 Apr 2015 22:16:11 +0000 (00:16 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/commands/class_BaseCommand.php

index ee56b2629d0fc5b31d34e92cacd3cd9fa76d30f5..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       $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
         */
         * @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());
 
                // This command doesn't handle any POST requests, so only handle get request
                assert(!$requestInstance->isPostRequestMethod());
 
@@ -74,7 +75,7 @@ class BaseCommand extends BaseFrameworkSystem {
                $templateInstance->assignTemplateWithVariable('footer', 'footer');
 
                // Load the content template
                $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');
 
                // Assign the content template with the master template as a content ... ;)
                $templateInstance->assignTemplateWithVariable($applicationInstance->getAppShortName() . '_' . $this->getResolverInstance()->getCommandName(), 'main_content');