diff options
author | xue <> | 2006-04-03 01:46:46 +0000 |
---|---|---|
committer | xue <> | 2006-04-03 01:46:46 +0000 |
commit | 1e0efb03df0ad2309a3e3bef64c6268a292373b9 (patch) | |
tree | 0ffa3a3369d2c262469d9df0d6d26ad7211ad1b5 | |
parent | 29130c17def4e63475b3fd775f48832e8d07bda0 (diff) |
Added BaseUrl property to THead.
-rw-r--r-- | framework/Web/UI/WebControls/THead.php | 18 |
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)
|