Checking Values

I have a custom function in my controller. I want to quickly check the value passed to the $temp variable. Can anyone suggest how I can do so?


public function actionOffence()

	{

    	        $data=Vehicle::model()->findByPk((int) $_POST['vehicleId']);

		$temp=$data->type;

	

	}



What do you mean by "check the value"?

I’ll take a guess here and assume you just want to retrieve the content of the variables, to check for debugging purposes.


var_dump($temp);

should do the trick.

For ease of reading / debugging I would suggest:


CVarDumper::dump($temp, 3, 1);

especially when dumping objects the cvardumper is really useful