From 9f1f5f2d172cff3951567d6040bbf8e42ce8a87c Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 7 Apr 2015 00:16:11 +0200 Subject: [PATCH] Added support for template suffix. This allows to load templates such as register_form, etc. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/commands/class_BaseCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/classes/main/commands/class_BaseCommand.php b/inc/classes/main/commands/class_BaseCommand.php index ee56b262..ac926819 100644 --- a/inc/classes/main/commands/class_BaseCommand.php +++ b/inc/classes/main/commands/class_BaseCommand.php @@ -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()); @@ -74,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'); -- 2.39.5