Jump to content

Redirect

Featured Replies

Posted

Hello, in IPB 3.x.x version I could used this code to redirect to another page : ipsRegistry::getClass('output')->silentRedirect($this->settings['my_url']);

How can I do that in version 4 ? 

Hello,

\IPS\Output::i()->redirect(\IPS\Http\Url::internal(''));
	/**
	 * Redirect
	 *
	 * @param	\IPS\Http\Url	$url			URL to redirect to
	 * @param	string			$message		Optional message to display
	 * @param	int				$httpStatusCode	HTTP Status Code
	 * @param	bool			$forceScreen	If TRUE, an intermediate screen will be shown
	 * @return	void
	 */
	public function redirect( $url, $message='', $httpStatusCode=301, $forceScreen=FALSE )

 

  • 2 months later...
2 hours ago, Fred Krugger said:

Hi @newbie LAC

How would it be for a page or block?

Hello,

{expression="\IPS\Output::i()->redirect(\IPS\Http\Url::internal(''))"}

 

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.