How To Check Whether Being Redirected Or Not?

I want to know how to check the page which user is viewing whether a redirected-page or user get to it by himself.

Currently, I use a redirected-flag in redirect method of CHttpRequest class and yiilite.php to get what I want. But I don’t think touching the core class of framework is a good idea.

That’s why the gods created inheritance.

And if you hate extending classes you can just check the referer.

not really understand your ideas, can you show me some pieces of code?

Create a class:


public MyRequest extends CHttpRequest{

}

In which you do whatever you want.

Then in the config/main use:


'components'=>array(

   'request'=>array(

      'class'=>'MyRequest'

   )

)

Thank you, I got it!