summaryrefslogtreecommitdiff
path: root/framework/Web/Services
diff options
context:
space:
mode:
authorxue <>2006-06-15 18:18:47 +0000
committerxue <>2006-06-15 18:18:47 +0000
commit6c0154fb4e292ad22667e618f598a37cc5f9d524 (patch)
tree925b51622b8f054d203050cd673eb48a24035c3c /framework/Web/Services
parentc8919fa9fc845ab7f3c6701b6de08c8cd042ec30 (diff)
Merge from 3.0 branch till 1166.
Diffstat (limited to 'framework/Web/Services')
-rw-r--r--framework/Web/Services/TPageService.php27
1 files changed, 25 insertions, 2 deletions
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php
index 1df4ffde..5172f59c 100644
--- a/framework/Web/Services/TPageService.php
+++ b/framework/Web/Services/TPageService.php
@@ -96,6 +96,10 @@ class TPageService extends TService
*/
private $_basePath=null;
/**
+ * @var string base path class in namespace format
+ */
+ private $_basePageClass='TPage';
+ /**
* @var string default page
*/
private $_defaultPage='Home';
@@ -398,6 +402,25 @@ class TPageService extends TService
}
/**
+ * Sets the base page class name (in namespace format).
+ * If a page only has a template file without page class file,
+ * this base page class will be instantiated.
+ * @param string class name
+ */
+ public function setBasePageClass($value)
+ {
+ $this->_basePageClass=$value;
+ }
+
+ /**
+ * @return string base page class name in namespace format. Defaults to 'TPage'.
+ */
+ public function getBasePageClass()
+ {
+ return $this->_basePageClass;
+ }
+
+ /**
* Runs the service.
* This will create the requested page, initializes it with the property values
* specified in the configuration, and executes the page.
@@ -417,9 +440,9 @@ class TPageService extends TService
throw new TConfigurationException('pageservice_pageclass_unknown',$className);
}
else
- $className='TPage';
+ $className=$this->getBasePageClass();
- $this->_page=new $className();
+ $this->_page=Prado::createComponent($className);
$this->_page->setPagePath($this->getRequestedPagePath());
// initialize page properties with those set in configurations