Redirect from within CFilter

Can anyone help or suggest a better way to do this?

I have setup a filter and want to redirect the user. It appears that Yii::app()->request->redirect() does not accept a query string in the same way that CController::redirect() does. How can I pass $_GET vars in my code below?




<?php

class SetUpFilter extends CFilter

{

	public $url;

	public $setUp;

	

    protected function preFilter($filterChain)

    {

    		if($this->setUp===null){

    		$request = Yii::app()->request;

    		$url = $request->baseUrl.'/setUp/index';

		$request->redirect($url, array('previousUrl'=>$this->url));

			}

			$filterChain->run();

		

    }

 

    protected function postFilter($filterChain)

    {

        // logic being applied after the action is executed

    }

}



$_GET[‘previousUrl’] is not being passed with the redirect.

Thank you.

code it this way




$params = $_GET['variable'];

$redirect = new Controller('setUp'); 

		$redirect->redirect(array('controller/action','params'=>$params)); 




i have not tested it. but hope it should work.

cheers

What about:




$filterChain->controller->redirect();



API: http://www.yiiframework.com/doc/api/1.1/CFilterChain

$filterChain->controller->redirect(); did the trick!!

Thanks to both of you.