think\Paginator::url PHP Method

url() protected method

获取页码对应的链接
protected url ( $page ) : string
$page
return string
    protected function url($page)
    {
        if ($page <= 0) {
            $page = 1;
        }
        if (strpos($this->options['path'], '[PAGE]') === false) {
            $parameters = [$this->options['var_page'] => $page];
            $path = $this->options['path'];
        } else {
            $parameters = [];
            $path = str_replace('[PAGE]', $page, $this->options['path']);
        }
        if (count($this->options['query']) > 0) {
            $parameters = array_merge($this->options['query'], $parameters);
        }
        $url = $path;
        if (!empty($parameters)) {
            $url .= '?' . urldecode(http_build_query($parameters, null, '&'));
        }
        return $url . $this->buildFragment();
    }