This is a bried guide about displaying of custom sql query results.
This is how i do before query on Yii 2.0