Append a redirect action to the render queue.

If $location does not start with "http", the dachi.baseURL configuration value will be prepended

@param  string $location The location to redirect to
@return null
177097
public static function redirect($location, $soft = false) {
		if(substr($location, 0, 4) !== "http")
			$location = Configuration::get("dachi.baseURL") . $location;

		self::$render_actions[] = array(
			"type"     => "redirect",
			"location" => $location,
			"soft"     => $soft
		);
	}
219519
public static function redirect($location, $permanent = false)
    {
        $redirect = new static($permanent ? 301 : 302);
        $redirect->setHeader('Location', $location);

        return $redirect;
    }
1189085
public function filter_wp_redirect( $location, $status ) {

		if ( ! $this->should_dispatch() ) {
			return $location;
		}

		$this->before_output();

		/* @var QM_Output_Headers[] */
		foreach ( $this->get_outputters( 'headers' ) as $id => $output ) {
			$output->output();
		}

		$this->after_output();

		return $location;

	}
346737
public function setLocation(string $location)
    {
        $dir = Directory::make($location, Directory::MAKE_DIRECTORY_EXISTS_OPEN);

        $old = $this->getPath();
        $new = $dir->getPath();

        if(rename($old, $new)) {
            $this->_location = $dir->getPath();
        }
    }
1022885
protected function redirect($location = null, $statusCode = 302)
    {
        return $this->response->redirect(url($location), true, $statusCode);
    }
1231755
public static function to($location, $data = null)
    {
        $location = ($location === '/') ? URL : URL . $location;

        $c = ($data) ? '?twigformfields='.base64_encode(json_encode($data)) : null;
        header('Location: ' . $location . $c);
        exit;
    }
435722
public function admin_modal_bail_user_redirect( $location ) {

		if ( ! pods_is_modal_window() ) {
			return $location;
		}

		global $user_id;

		$user = get_userdata( $user_id );

		if ( ! $user || is_wp_error( $user ) ) {
			return $location;
		}

		$field_args = (object) array(
			'options' => array(
				'pick_object' => 'user',
				'pick_val'    => '',
			),
			'value'   => array(
				$user->ID => $user->display_name,
			),
		);

		$this->admin_modal_bail( $user->ID, $user->display_name, $field_args );

		return $location;

	}
1333145
public function addSiteMap($location, $lastModification = null)
    {
        $sitemapElement = $this->createElement('sitemap');

        if (0 === strpos($location, '/')) {
            $location = $this->baseUri.$location;
        }
        $locElement = $this->createElement('loc');
        $locElement->appendChild($this->createTextNode($location));
        $sitemapElement->appendChild($locElement);

        if (null !== $lastModification) {
            if ($lastModification instanceof \DateTime) {
                $lastModification = $lastModification->format('c');
            } else {
                if (is_string($lastModification)) {
                    $lastModification = strtotime($lastModification);
                }
                $lastModification = date('c', $lastModification);
            }

            $lastmodElement = $this->createElement('lastmod');
            $lastmodElement->appendChild($this->createTextNode($lastModification));
            $sitemapElement->appendChild($lastmodElement);
        }

        $this->root->appendChild($sitemapElement);

        return $this;
    }
117258
private function createLocationAddForm(Location $location): FormInterface
    {
        return $this->formFactory->addLocation(
            new ContentLocationAddData($location->getContentInfo())
        );
    }
683323
public function setLocation(\CampaignChain\CoreBundle\Entity\Location $location = null)
    {
        $this->location = $location;

        return $this;
    }
204101
public static function noframes($location = 'top.location.href')
	{
		// Only load once
		if (isset(self::$loaded[__METHOD__]))
		{
			return;
		}

		// Include MooTools framework
		self::framework();

		//$js = "window.addEvent('domready', function () {if (top == self) {document.documentElement.style.display = 'block'; }" .
		//	" else {top.location = self.location; }});";
		$js = "jQuery(document).ready(function($){
			if (top == self) {
				document.documentElement.style.display = 'block';
			} else {
				top.location = self.location;
			}
		});";
		$document = App::get('document');
		$document->addStyleDeclaration('html { display:none }');
		$document->addScriptDeclaration($js);

		App::get('response')->headers->set('X-Frame-Options', 'SAMEORIGIN');

		self::$loaded[__METHOD__] = true;
	}
509988
public static RedirectionAction buildRedirectUrlAction(final WebContext context, final String location) {
        if (ContextHelper.isPost(context) && useModernHttpCodes) {
            return new SeeOtherAction(location);
        } else {
            return new FoundAction(location);
        }
    }
1277675
protected function searchLocation($location)
	{
		$request = file_get_contents(
			sprintf(
				'https://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false&key=%s',
				urlencode($location),
				$this->getKey()
			)
		);

		return json_decode($request);
	}
1212837
public function doGenerate($location, array $parameters)
    {
        $urlAliasService = $this->repository->getURLAliasService();

        $siteaccess = null;
        if (isset($parameters['siteaccess'])) {
            $siteaccess = $parameters['siteaccess'];
            unset($parameters['siteaccess']);
        }

        if ($siteaccess) {
            // We generate for a different SiteAccess, so potentially in a different language.
            $languages = $this->configResolver->getParameter('languages', null, $siteaccess);
            $urlAliases = $urlAliasService->listLocationAliases($location, false, null, null, $languages);
            // Use the target SiteAccess root location
            $rootLocationId = $this->configResolver->getParameter('content.tree_root.location_id', null, $siteaccess);
        } else {
            $languages = null;
            $urlAliases = $urlAliasService->listLocationAliases($location, false);
            $rootLocationId = $this->rootLocationId;
        }

        $queryString = '';
        unset($parameters['language'], $parameters['contentId']);
        if (!empty($parameters)) {
            $queryString = '?' . http_build_query($parameters, '', '&');
        }

        if (!empty($urlAliases)) {
            $path = $urlAliases[0]->path;
            // Remove rootLocation's prefix if needed.
            if ($rootLocationId !== null) {
                $pathPrefix = $this->getPathPrefixByRootLocationId($rootLocationId, $languages, $siteaccess);
                // "/" cannot be considered as a path prefix since it's root, so we ignore it.
                if ($pathPrefix !== '/' && ($path === $pathPrefix || mb_stripos($path, $pathPrefix . '/') === 0)) {
                    $path = mb_substr($path, mb_strlen($pathPrefix));
                } elseif ($pathPrefix !== '/' && !$this->isUriPrefixExcluded($path) && $this->logger !== null) {
                    // Location path is outside configured content tree and doesn't have an excluded prefix.
                    // This is most likely an error (from content edition or link generation logic).
                    $this->logger->warning("Generating a link to a location outside root content tree: '$path' is outside tree starting to location #$rootLocationId");
                }
            }
        } else {
            $path = $this->defaultRouter->generate(
                self::INTERNAL_CONTENT_VIEW_ROUTE,
                array('contentId' => $location->contentId, 'locationId' => $location->id)
            );
        }

        $path = $path ?: '/';

        // replace potentially unsafe characters with url-encoded counterpart
        return strtr($path . $queryString, $this->unsafeCharMap);
    }
1213990
public function setLocation(string $location)
    {
        if (empty($location)) {
            Throw new HeaderException('Empty location is now allowed.');
        }

        $this->location = $location;
    }
279746
public function listPlaceListAction(Location $location)
    {
        /** @var \EzSystems\DemoBundle\Helper\PlaceHelper $placeHelper */
        $placeHelper = $this->get('ezdemo.place_helper');

        $places = $placeHelper->getPlaceList(
            $location,
            $this->container->getParameter('ezdemo.places.place_list.content_types'),
            $this->getConfigResolver()->getParameter('languages')
        );

        return $this->render(
            'eZDemoBundle:parts/place:place_list.html.twig',
            array('places' => $places)
        );
    }
862117
public function addLocation(\CampaignChain\CoreBundle\Entity\Location $location)
    {
        $this->locations[] = $location;

        return $this;
    }