From: Roland Häder Date: Fri, 8 Aug 2008 20:32:08 +0000 (+0000) Subject: Link base added to helper X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a03c1f9c8a5c4e4bbc01a3178e43f8fb1888f5dd;p=shipsimu.git Link base added to helper --- diff --git a/inc/classes/main/helper/web/links/class_WebLinkHelper.php b/inc/classes/main/helper/web/links/class_WebLinkHelper.php index f407889..dc30bfe 100644 --- a/inc/classes/main/helper/web/links/class_WebLinkHelper.php +++ b/inc/classes/main/helper/web/links/class_WebLinkHelper.php @@ -27,6 +27,11 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { */ private $linkName = ""; + /** + * Base of the link + */ + private $linkBase = ""; + /** * Protected constructor * @@ -42,18 +47,22 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { * * @param $templateInstance An instance of a template engine * @param $linkName Name of the link we shall generate + * @param $linkBase Link base for all generated links * @return $helperInstance A prepared instance of this helper */ - public final static function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName) { + public final static function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase) { // Get new instance $helperInstance = new WebLinkHelper(); // Set template instance $helperInstance->setTemplateInstance($templateInstance); - // Set Link name + // Set link name $helperInstance->setLinkName($linkName); + // Set link base + $helperInstance->setLinkBase($linkBase); + // Return the prepared instance return $helperInstance; } @@ -77,6 +86,25 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { return $this->linkName; } + /** + * Setter for link base + * + * @param $linkBase Base of the link we shall generate + * @return void + */ + protected final function setLinkBase ($linkBase) { + $this->linkBase = (string) $linkBase; + } + + /** + * Getter for link base + * + * @return $linkBase Base of the link we shall generate + */ + public final function getLinkBase () { + return $this->linkBase; + } + /** * Flush the content out,e g. to a template variable *