Function setRedirectUrl

@author: 713uk13m <dev@nguyenanhung.com>
@time  : 9/27/18 20:20

@param string $redirectUrl

@return $this|mixed
497685
public function setRedirectUrl($redirectUrl = '')
    {
        $this->redirectUrl = $redirectUrl;
        $this->debug->debug(__FUNCTION__, 'setRedirectUrl: ' . json_encode($this->redirectUrl));

        return $this;
    }
62008
public function setUrl($url)
    {
        $this->meta()->setUrl($url);
        $this->openGraph()->setUrl($url);

        return $this;
    }
969339
public function setRedirectView($redirectView)
    {
        if (!is_file($redirectView)) {
            throw new \RuntimeException(sprintf('Redirect view file "%s" not found', $redirectView));
        }
        $this->redirectView = $redirectView;
        return $this;
    }
813140
public function setUrl($url)
    {
        $this->httpClientBuilder->removePlugin(AddHostPlugin::class);
        $this->httpClientBuilder->addPlugin(new AddHostPlugin(UriFactoryDiscovery::find()->createUri($url)));

        return $this;
    }
1233442
public function setUrl($url)
    {
        $this->_rawUrl = $url;
        if (strncasecmp($url, 'http://', 7) && strncasecmp($url, 'https://', 8) && isset($_SERVER['HTTP_HOST'])) {
            if (substr($url, 0, 1) != '/') {
                $url = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/') + 1) . $url;
            }
            $url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
        }
        $this->_url = str_replace('&amp;', '&', $url);
        $this->_urlParams = null;
    }
786348
public function redirect($url = null)
    {
        if (null === $url) {
            $url = $this->getServer('HTTP_ORIGIN');
        }
        ob_start();
        header('Location: ' . $url);
        ob_end_clean();
        Security::getInstance()->updateSession();
        exit(t('Redireccionando...'));
    }
1131504
public function generate($redirectUrl)
    {
        return (string) $this->queryHelper
            ->setValue('url', $redirectUrl)
            ->applyToUri($this->uri);
    }
1158698
public function setRedirect($url, $code = 302)
    {
        $this->canSendHeaders(true);
        $this->setHeader('Location', $url, true)
             ->setHttpResponseCode($code);

        return $this;
    }
1147968
public function setUrl($url)
    {
        $this->url = $url;

        // Normalize URL if its relative (strictly speaking), or has leading slashes
        if (Director::is_relative_url($url) || preg_match('/^\//', $url)) {
            $this->url = preg_replace(array('/\/+/','/^\//', '/\/$/'), array('/','',''), $this->url);
        }
        if (preg_match('/^(.*)\.([A-Za-z][A-Za-z0-9]*)$/', $this->url, $matches)) {
            $this->url = $matches[1];
            $this->extension = $matches[2];
        }
        if ($this->url) {
            $this->dirParts = preg_split('|/+|', $this->url);
        } else {
            $this->dirParts = array();
        }

        return $this;
    }
634480
public function setBaseUrl($url)
    {
        if (substr($url, -1) != '/') {
            $url .= '/';
        }

        if (substr($url,-4,4) != 'api/') {
            $url .= 'api/';
        }

        $this->baseUrl = $url;

        return $this;
    }
382483
public function setRedirectUrl($redirect = null, $key = null) {
		if (empty($redirect)) {
			$redirect = $this->_controller->request->referer(true);
		} elseif ($redirect === true) {
			$redirect = $this->_controller->request->here(true);
		}
		if (empty($redirect) || $this->_controller->request->is('popup') ||
			$this->_controller->request->is('print')) {
			return false;
		}
		$cacheKey = $this->_getSessionKeyRedirect($key);
		$data = CakeSession::read($cacheKey);
		if (!empty($data) && (md5((string)$data) === md5((string)$redirect))) {
			return false;
		}

		return CakeSession::write($cacheKey, $redirect);
	}
50903
public function setRedirectType($type) {
        if (!is_int($type)) throw new IllegalTypeException('Illegal type of parameter $type: '.gettype($type));

        $this->redirectType = $type;
        return $this;
    }
105842
public function setMaxRedirect($maxRedirect)
    {
        $maxRedirect = intval($maxRedirect);
        if (!empty($maxRedirect)) {
            $this->maxRedirect = $maxRedirect;
        }
    }
364959
public function setRedirect($redirect) {
        if (!is_bool($redirect)) throw new IllegalTypeException('Illegal type of parameter $redirect: '.gettype($redirect));

        $this->redirect = $redirect;
        return $this;
    }
1204188
public function setUrl($url)
    {
        if (!filter_var($url, FILTER_VALIDATE_URL))
        {
            throw new InvalidDataException('Invalid url link');
        }

        $this->url = $url;

        return $this;
    }
1369876
public function setUrl($url)
    {
        $this->currentUrl = $url;
        $this->misc->setUrl($url);

        return $this;
    }
1022709
public function setUrl(HttpUrl $url)
    {
        //Remove the user and pass from the view url
        unset($url->user);
        unset($url->pass);

        $this->__url = $url;
        return $this;
    }