Piwik\Plugins\Installation\View::render PHP Method

render() public method

public render ( )
    public function render()
    {
        // prepare the all steps templates
        $this->currentStepId = array_search($this->currentStepName, $this->steps);
        $this->totalNumberOfSteps = count($this->steps);
        $this->percentDone = round($this->currentStepId * 100 / ($this->totalNumberOfSteps - 1));
        $this->percentToDo = 100 - $this->percentDone;
        $this->nextModuleName = '';
        if (isset($this->steps[$this->currentStepId + 1])) {
            $this->nextModuleName = $this->steps[$this->currentStepId + 1];
        }
        $this->previousModuleName = '';
        if (isset($this->steps[$this->currentStepId - 1])) {
            $this->previousModuleName = $this->steps[$this->currentStepId - 1];
        }
        $this->previousPreviousModuleName = '';
        if (isset($this->steps[$this->currentStepId - 2])) {
            $this->previousPreviousModuleName = $this->steps[$this->currentStepId - 2];
        }
        $this->piwikVersion = Version::VERSION;
        return parent::render();
    }

Usage Example

Example #1
0
 /**
  * Installation Step 8: Finished!
  */
 public function finished()
 {
     $this->checkPiwikIsNotInstalled();
     $view = new View('@Installation/finished', $this->getInstallationSteps(), __FUNCTION__);
     $form = new FormDefaultSettings();
     /**
      * Triggered on initialization of the form to customize default Piwik settings (at the end of the installation process).
      *
      * @param \Piwik\Plugins\Installation\FormDefaultSettings $form
      */
     Piwik::postEvent('Installation.defaultSettingsForm.init', array($form));
     $form->addElement('submit', 'submit', array('value' => Piwik::translate('General_ContinueToPiwik') . ' ยป', 'class' => 'btn btn-lg'));
     if ($form->validate()) {
         try {
             /**
              * Triggered on submission of the form to customize default Piwik settings (at the end of the installation process).
              *
              * @param \Piwik\Plugins\Installation\FormDefaultSettings $form
              */
             Piwik::postEvent('Installation.defaultSettingsForm.submit', array($form));
             $this->markInstallationAsCompleted();
             Url::redirectToUrl('index.php');
         } catch (Exception $e) {
             $view->errorMessage = $e->getMessage();
         }
     }
     $view->addForm($form);
     $view->showNextStep = false;
     $output = $view->render();
     return $output;
 }
All Usage Examples Of Piwik\Plugins\Installation\View::render