code: public function setPage($value, $validatePage = false)
      {
          if ($value === null) {
              $this->_page = null;
          } else {
              $value = (int) $value;
              if ($validatePage && $this->validatePage) {
                  $pageCount = $this->getPageCount();
                  if ($value >= $pageCount) {
                      $value = $pageCount - 1;
                  }
              }
              if ($value < 0) {
                  $value = 0;
              }
              $this->_page = $value;
          }
      }
docs: Sets the current page number.
  @param int $value the zero-based index of the current page.
  @param bool $validatePage whether to validate the page number. Note that in order
  to validate the page number, both [[validatePage]] and this parameter must be true.