What is the best way to make a $_GET variable safe when you are not passing it through the parameters of the "action" method?

Is there a Yii way to do this? or will I need to use standard php?

For what do you need it to make safe? Are you going to use it for a database query? To make data safe for querying, you kan use parameterized statements which are explained here as binding parameters.

Well yes it does have to query the database using the findByPK method.

I was really looking for a function to just wrap around the $_GET to make it safe like …


I think something must exist in Yii, and as a fall back php.