Prado\Web\UI\WebControls\TTabPanel::getActiveView PHP 메소드

getActiveView() 공개 메소드

This method will examin the ActiveViewID, ActiveViewIndex and Views collection to determine which view is currently active. It will update ActiveViewID and ActiveViewIndex accordingly.
public getActiveView ( ) : TTabView
리턴 TTabView the currently active view, null if no active view
    public function getActiveView()
    {
        $activeView = null;
        $views = $this->getViews();
        if (($id = $this->getActiveViewID()) !== '') {
            if (($index = $views->findIndexByID($id)) >= 0) {
                $activeView = $views->itemAt($index);
            } else {
                throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id);
            }
        } else {
            if (($index = $this->getActiveViewIndex()) >= 0) {
                if ($index < $views->getCount()) {
                    $activeView = $views->itemAt($index);
                } else {
                    throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index);
                }
            } else {
                foreach ($views as $index => $view) {
                    if ($view->getActive()) {
                        $activeView = $view;
                        break;
                    }
                }
            }
        }
        if ($activeView !== null) {
            $this->activateView($activeView);
        }
        return $activeView;
    }