本文整理汇总了PHP中TPage::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP TPage::execute方法的具体用法?PHP TPage::execute怎么用?PHP TPage::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPage
的用法示例。
在下文中一共展示了TPage::execute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Executes page lifecycles for a callback request
*
* If the page is requested is not a service request
* - Execute the normal page lifecycles @see TPage::execute()
*
* If the page is requested in response to a AJAX request
* (may be a Callback request) then
* - OnInit event
* - OnLoad event
* - ** execute service **
* - OnUnload event
* - ** flush server outputs **
*
* If the page is requested in response to a valid Callback request, then
* - OnInit event
* - ** initialize the server request **
* - ** load post data from request **
* - load viewstate
* - load post data
* - OnLoad event
* - load post data (for newly created components during Load event)
* - ** raise callback event **
* - OnUnload event
* - ** flush server outputs **
*
* @see TPage::execute()
*/
public function execute()
{
//Callback life-cycle
if ($this->service->isServiceRequest()) {
if ($this->Application->getApplicationState() == TApplication::STATE_DEBUG) {
//let the callback server handle errors and exceptions
$server = $this->service->server();
set_error_handler(array($server, 'handleError'));
set_exception_handler(array($server, 'handleException'));
}
$this->onPreInit(new TEventParameter());
$this->determinePostBackMode();
$this->onInitRecursive(new TEventParameter());
$this->service->register($this);
//a valid callback request
if ($this->isCallBack()) {
$this->service->server()->initialize();
$this->service->loadCallBackPostData();
$state = $this->loadPageStateFromPersistenceMedium();
$this->loadViewState($state);
$this->loadPostData();
$this->onLoadRecursive(new TEventParameter());
$this->loadPostData();
/** raise post back data changed or not? **/
//$this->raisePostDataChangedEvents();
//$this->handlePostBackEvent();
} else {
$this->onLoadRecursive(new TEventParameter());
}
$this->service->execute();
$this->onUnloadRecursive(new TEventParameter());
$this->service->server()->flush();
} else {
//normal page execution cycle
parent::execute();
}
}
示例2: execute
function execute()
{
if ($this->isServiceRequest()) {
$this->onPreInit(new TEventParameter());
$this->determinePostBackMode();
$this->onInitRecursive(new TEventParameter());
$this->service->setPostDataKeys($this->postDataContainerIDs);
if ($this->isCallBack()) {
$this->service->loadCallBackPostData();
try {
$state = $this->loadPageStateFromPersistenceMedium();
$this->loadViewState($state);
$this->loadPostData();
$this->onLoadRecursive(new TEventParameter());
$this->loadPostData();
$this->raisePostDataChangedEvents();
$this->handlePostBackEvent();
} catch (Exception $e) {
if ($this->Application->getApplicationState() == TApplication::STATE_DEBUG) {
trigger_error($e->getMessage());
}
}
} else {
$this->onLoadRecursive(new TEventParameter());
}
$this->registerCallbackHandler($this, $this->getCallbackCandidateDescriptions());
$this->Application->getServiceManager()->execute(TService_Callback::service);
$this->onUnloadRecursive(new TEventParameter());
} else {
parent::execute();
}
}