protected function Redirect($action, $feedback =  null, $params = "", $mode = "")
	{
		if (!$mode) $mode = self::$DefaultRedirectMode;

		$params = is_array($params) ? $params : array();

		if ($feedback != null)
		{
			$this->Context->Set("feedback",$feedback);
		}

		// support for deprecated Controller/Method format
		list($controller,$method) = explode(".", str_replace("/",".",$action));

		$url = $this->GetRouter()->GetUrl($controller,$method,$params);

		// capture output instead of rendering if specified
		if ($this->CaptureOutputMode)
		{
			if ($mode == 'client')
			{
				$this->RenderEngine->assign("url",$url);
				$this->DebugOutput = $this->RenderEngine->fetch("_redirect.tpl");
			}
			else
			{
				$this->DebugOutput = 'Location: ' . $url;
			}
		}
		else
		{

			if ($mode == 'client')
			{
				$this->RenderEngine->assign("url",$url);
				$this->RenderEngine->display("_redirect.tpl");
			}
			else
			{
				header('Location: ' . $url) ;
			}

		}

		// don't exit if we are unit testing because it will stop all further tests
		if (!$this->UnitTestMode) exit;

	}
protected function Redirect($action, $feedback =  null, $params = "", $mode = "")
	{
		if (!$mode) $mode = self::$DefaultRedirectMode;

		$params = is_array($params) ? $params : array();

		if ($feedback != null)
		{
			$this->Context->Set("feedback",$feedback);
		}

		// support for deprecated Controller/Method format
		list($controller,$method) = explode(".", str_replace("/",".",$action));

		$url = $this->GetRouter()->GetUrl($controller,$method,$params);

		// capture output instead of rendering if specified
		if ($this->CaptureOutputMode)
		{
			if ($mode == 'client')
			{
				$this->RenderEngine->assign("url",$url);
				$this->DebugOutput = $this->RenderEngine->fetch("_redirect.tpl");
			}
			else
			{
				$this->DebugOutput = 'Location: ' . $url;
			}
		}
		else
		{

			if ($mode == 'client')
			{
				$this->RenderEngine->assign("url",$url);
				$this->RenderEngine->display("_redirect.tpl");
			}
			else
			{
				header('Location: ' . $url) ;
			}

		}

		// don't exit if we are unit testing because it will stop all further tests
		if (!$this->UnitTestMode) exit;

	}
protected function Redirect ( $ action , $ feedback = null , $ params = "" , $ mode = "" ) { if ( ! $ mode ) $ mode = self :: $ DefaultRedirectMode ; $ params = is_array ( $ params ) ? $ params : array ( ) ; if ( $ feedback != null ) { $ this -> Context -> Set ( "feedback" , $ feedback ) ; } // support for deprecated Controller/Method format
 list ( $ controller , $ method ) = explode ( "." , str_replace ( "/" , "." , $ action ) ) ; $ url = $ this -> GetRouter ( ) -> GetUrl ( $ controller , $ method , $ params ) ; // capture output instead of rendering if specified
 if ( $ this -> CaptureOutputMode ) { if ( $ mode == 'client' ) { $ this -> RenderEngine -> assign ( "url" , $ url ) ; $ this -> DebugOutput = $ this -> RenderEngine -> fetch ( "_redirect.tpl" ) ; } else { $ this -> DebugOutput = 'Location: ' . $ url ; } } else { if ( $ mode == 'client' ) { $ this -> RenderEngine -> assign ( "url" , $ url ) ; $ this -> RenderEngine -> display ( "_redirect.tpl" ) ; } else { header ( 'Location: ' . $ url ) ; } } // don't exit if we are unit testing because it will stop all further tests
 if ( ! $ this -> UnitTestMode ) exit ; }
Redirect to the appropriate page based on the action.  This function will
call "exit" so do not put any code that you wish to execute after Redirect

@param string $action in the format Controller.Method
@param mixed $feedback string which will be assigne to the template as "feedback" or an array of values to assign
@param array $params
@param string $mode (client | header) default = Controller::$DefaultRedirectMode
Redirect to the appropriate page based on the action . This function will call exit so do not put any code that you wish to execute after Redirect