how to print model query in yii2 code example Example: yii2 print model header('Content-type: text/plain'); print_r($var); exit;