public function redirectToPage($url, $query = null, $picoOnly = true)
    {
        $finalUrl = "/";
        
        if ($picoOnly) {
            $append = "";

            if ($query) {
                if (!is_string($query)) {
                    throw new \InvalidArgumentException("Query must be a string.");
                }
                $rewrite = $this->getPico()->isUrlRewritingEnabled();
                $urlChar = ($rewrite) ? '?' : '&';
                $append .= $urlChar . $query;
            }
            $finalUrl = $this->pico->getPageUrl($url) . $append;
        } else {
            $finalUrl = $url;
        }
        
        header('Location: ' . $finalUrl);
        exit();
    }
public function redirectToPage($url, $query = null, $picoOnly = true)
    {
        $finalUrl = "/";
        
        if ($picoOnly) {
            $append = "";

            if ($query) {
                if (!is_string($query)) {
                    throw new \InvalidArgumentException("Query must be a string.");
                }
                $rewrite = $this->getPico()->isUrlRewritingEnabled();
                $urlChar = ($rewrite) ? '?' : '&';
                $append .= $urlChar . $query;
            }
            $finalUrl = $this->pico->getPageUrl($url) . $append;
        } else {
            $finalUrl = $url;
        }
        
        header('Location: ' . $finalUrl);
        exit();
    }
{@inheritdoc}