コード例 #1
0
 function execute()
 {
     $this->mStartTime = NBFrame::getClock();
     $this->mRequest->defParam('op', '', 'var', $this->mDefaultOp);
     $result = $this->_actionDispatch();
     switch ($result) {
         case NBFRAME_ACTION_VIEW_DEFAULT:
             $preViewMethod = 'preView' . ucfirst($this->mOp) . 'Op';
             if (method_exists($this, $preViewMethod)) {
                 $this->{$preViewMethod}();
             }
             $this->startRender();
             $viewMethod = 'view' . ucfirst($this->mOp) . 'Op';
             if (method_exists($this, $viewMethod)) {
                 $this->{$viewMethod}();
             }
             $this->endRender();
             $postViewMethod = 'postView' . ucfirst($this->mOp) . 'Op';
             if (method_exists($this, $postViewMethod)) {
                 $this->{$postViewMethod}();
             }
             break;
         case NBFRAME_ACTION_VIEW_EXTRA:
             $preViewExtraMethod = 'preView' . $this->mExtraShowMethod;
             if (method_exists($this, $preViewExtraMethod)) {
                 $this->{$preViewExtraMethod}();
             }
             $this->startRender();
             $extraMethod = 'view' . $this->mExtraShowMethod;
             if (method_exists($this, $extraMethod)) {
                 $this->{$extraMethod}();
             }
             $this->endRender();
             $postViewExtraMethod = 'postView' . $this->mExtraShowMethod;
             if (method_exists($this, $postViewExtraMethod)) {
                 $this->{$postViewExtraMethod}();
             }
             break;
         case NBFRAME_ACTION_SUCCESS:
             $this->executeActionSuccess();
             break;
         case NBFRAME_ACTION_ERROR:
             $this->executeActionError();
             break;
         default:
             break;
     }
     $this->mElapsedTime = NBFrame::getClock() - $this->mStartTime;
 }