summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls
diff options
context:
space:
mode:
authorxue <>2006-04-03 01:46:46 +0000
committerxue <>2006-04-03 01:46:46 +0000
commit1e0efb03df0ad2309a3e3bef64c6268a292373b9 (patch)
tree0ffa3a3369d2c262469d9df0d6d26ad7211ad1b5 /framework/Web/UI/WebControls
parent29130c17def4e63475b3fd775f48832e8d07bda0 (diff)
Added BaseUrl property to THead.
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r--framework/Web/UI/WebControls/THead.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php
index 40736a92..5c91002b 100644
--- a/framework/Web/UI/WebControls/THead.php
+++ b/framework/Web/UI/WebControls/THead.php
@@ -97,6 +97,22 @@ class THead extends TControl
}
/**
+ * @return string base URL of the page. This URL is rendered as the 'href' attribute of <base> tag. Defaults to ''.
+ */
+ public function getBaseUrl()
+ {
+ return $this->getViewState('BaseUrl','');
+ }
+
+ /**
+ * @param string base URL of the page. This URL is rendered as the 'href' attribute of <base> tag.
+ */
+ public function setBaseUrl($url)
+ {
+ $this->setViewState('BaseUrl',$url,'');
+ }
+
+ /**
* @return TMetaTagCollection meta tag collection
*/
public function getMetaTags()
@@ -118,6 +134,8 @@ class THead extends TControl
$page=$this->getPage();
$title=$this->getTitle();
$writer->write("<head>\n<title>".THttpUtility::htmlEncode($title)."</title>\n");
+ if(($baseUrl=$this->getBaseUrl())!=='')
+ $writer->write('<base href="'.$baseUrl."\" />\n");
if(($metaTags=$this->getMetaTags())!==null)
{
foreach($metaTags as $metaTag)