How to pass variable value to a different controller ?

Hi, How to pass variable value to a different controller ?

I was try to build application that need to interact using 2 or more models.

My first methode (and its working) is to build single controller and many view for different scenario, well it’s quite long work.

Now i try my second methode, that is when user do something to one view (that connect to some model) user will redirecting to that model controller thus that specific controller will take over, including view etc.

The problem is i need to pass some variable from controller to another controller, the point is i need to ‘hide’ some values so that the user wont make a mistake when input a form in another controller/view (what i need is not validator kind)

Thank You

In this case, I set some session vars and then I do a redirection :


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

if ($model->validate())

                {

                    $model->save(false);

                    $session['success'] = $model->foobar;

                    $this->redirect(array(bu() . '/controller/action'));

                }