Redirect

@param string $name Route name
@param array  $args Associative array of route arguments
769234
protected function redirect($routeName, $args = [])
    {
        // Save any alert messages to session flash data
        if (isset($this->alert)) {
            $session = $this->container->sessionHandler;
            $session->setFlashData('alert', $this->alert);
        }

        return $this->response->withRedirect($this->container->router->pathFor($routeName, $args));
    }
1348578
protected function cutArgument($name, &$args)
    {
        if (isset($args[$name])) {
            $result = $args[$name];
            unset($args[$name]);
            return $result;
        }

        return null;
    }
661899
public static function trigger(string $name, ?array $args = null)
  {
    if (!isset(self::$events[$name])) return false;

    foreach (self::$events[$name] as $event => $callback) {
      if (is_callable($callback)) {
        return call_user_func_array($callback, isset($args) ? $args : []);
      }
      else if (is_array($callback)) {
        (new Events)->triggerGroup($callback, $args);
      }
      else if (is_string($callback)) {
        $call = new $callback;
        return call_user_func_array([$call, 'persist'], $args ?? []);
      }
    }
  }
1334030
public function render($name, $args = []) {

        if(strstr($name, '::')) {

            $name = explode('::', $name);
        
        } else {

            $name = [$name, strtolower($name)];
        }


        if($this->set('module[controller]', $name[0])) {

            $module = $this->get('module');

            if(isset($module['name'])) {

                ob_start();

                if(method_exists($instance = $this->controller($module['name'], $name[0]), $name[1])) {

                    if($ref = new \ReflectionMethod($instance, $name[1])) {

                        $ref->invokeArgs($instance, $args);
                    }
                }

                $content = ob_get_contents();

                ob_end_clean();


                return $content;
            }
        }
    }
946379
public static function redirect(
		\Slim\Slim $slim, $name, $to, $routeName = null
	) {
		$routeName = $routeName ?: $name;

		$slim->get( $name, function () use ( $slim, $name, $to ) {
			$slim->flashKeep();
			$slim->redirect( $slim->urlFor( $to ) );
		} )->name( $routeName );
	}
272256
public function move_site( $args, $assoc_args ) {
		list( $site_id, $new_network_id ) = $args;

		$network_id = move_site( $site_id, $new_network_id );

		if ( is_wp_error( $network_id ) ) {
			WP_CLI::error( $network_id );
		}

		WP_CLI::success( sprintf( 'Site %1$d has moved to network %2$d.', $site_id, $new_network_id ) );
	}
614454
public function redirectToRoute($routeName, array $parameters = [])
    {
        $url = $this->router->getRouteUrlByName($routeName, $parameters);
        if (!$url) {
            throw new \Parable\Framework\Exception("Can't redirect to route, '{$routeName}' does not exist.");
        }
        $this->response->redirect($this->url->getUrl($url));
    }
601880
public function addQuery($name, $args)
    {
        $name = $this->snakeCase($name);

        $this->query[$name] = $args[0];

        return $this;
    }
1251451
public static function render($name, $args = array())
    {
        global $PPHP;

        array_merge_assoc(
            self::$_stash,
            $args,
            array(
                'config' => $PPHP['config'],
                'session' => $_SESSION,
                'req' => grab('request')
            )
        );
        try {
            self::$_safeBody .= self::$_twig->render($name, self::$_stash);
        } catch (\Exception $e) {
            echo $e->getMessage();
        };
    }
384335
public function invokeMethod($name, array $args = array(), $object = null)
    {
        return $this->getMethod($name)->invokeArgs($this->getObject($object), $args);
    }
1207211
public function redirectRoute($name, $params = [], $statusCode = 302) {
		$this->redirect($this->urlGenerator->generate($name, $params), $statusCode);
		return $this;
	}
179811
public function middleware($name)
    {
        if (is_string($name)) {
            app()->addRouteMiddleware($name);
        } else if (is_array($name)) {
            foreach ($name as $middlewareName) {
                app()->addRouteMiddleware($middlewareName);
            }
        }
    }
395595
public function redirect($page = null, $arg = array())
    {
        $url = $this->app->url($page, $arg);

        return $this->univ()->_fn('redirect', array($url));
    }
1082571
public static function section($name, $args, $child) {
		//Convenient under the hood change to
		//make things easier
		$args["sectionPath"] = $args["path"];
		unset($args["path"]);

		//Add to sections
		Router::$sections[] = [$name, $args, $child, Router::$context];
	}
804696
public function ajaxRedirect(string $destination, array $args = []): void
	{
		$this->payload->forceRedirect = $this->link($destination, $args);
		$this->sendPayload();
	}
282891
protected function handle($name, array $args = [])
    {
        if (isset($this->handlers[$name]) && is_callable($this->handlers[$name])) {
            array_unshift($args, $this);
            call_user_func_array($this->handlers[$name], $args);
        }
    }
676024
public function runMacro($name, $args)
    {
        if (isset($this->macros[$name])) {
            if (is_callable($this->macros[$name])) {
                return call_user_func_array($this->macros[$name], array_merge([$this], $args));
            }
        }
    }