diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/Services/TPageService.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index aed9d3e0..58b7d57b 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -409,16 +409,19 @@ class TPageService extends TService $className=basename($path);
if(!class_exists($className,false))
include_once($path.Prado::CLASS_FILE_EXT);
- if(!class_exists($className,false))
- throw new TConfigurationException('pageservice_pageclass_unknown',$className);
}
else
+ {
$className=$this->getBasePageClass();
+ Prado::using($className);
+ if(($pos=strrpos($className,'.'))!==false)
+ $className=substr($className,$pos+1);
+ }
- if($className!=='TPage' && !is_subclass_of($className,'TPage'))
- throw new TConfigurationException('pageservice_pageclass_invalid',$className);
+ if(!class_exists($className,false) || ($className!=='TPage' && !is_subclass_of($className,'TPage')))
+ throw new THttpException(404,'pageservice_page_unknown',$pagePath);
- $page=Prado::createComponent($className);
+ $page=new $className;
$page->setPagePath($pagePath);
if($hasTemplateFile)
|