How to use action from a different controller

Hi all,

I am still very new to Yii, so hopefully my question is not too silly. I would like to use a 3 step form in a second controller. The first 2 steps of the form are the same, but then it changes according to where I came from originally. If I can, then I would like to keep my URL on top, so people do not get confused that I have changed into a different section.

I now wanted to use the following code.

first controller

public function actionCreate()


  // Check the route to identify where the user came from

  if( Yii::app()->controller->route == 'firstController/create'){

      $model->location = 'firstController';


      $model->location = 'secondController';



second controller

public function actionCreate()




Unfortunately, ii only shows me the route from the first Controller and never the second controller. How can I achieve that? Yes I know, I could set a Session as well, but I would like to see if this approach is possible.

How can I achieve that?

So you want to redirect to the second controller but you want it to look like it’s the first controller?

Mmh, I guess you could say redirect. On step 3 I have to redirect again back to my Second Controller (if that is where I came from) for the last step of the form.

I guess the most simple solution would be a session variable…