in PHP coding, we usually need check if the class method exist, if we direct call without check we could get exception. In Yii 2.0 framework, we can also use this way to check model's relation exist.
When setting ajax request in Yii 2.0 framework, always get 400 error "Unable to verify your data submission.", found the problem is csrf cookies not set correct by test, this topic will show how to fix it.
When Post Data in Yii 2.0 Framework will get this kind error "Bad Request #400 Unable to verify your data submission", reason is because CSRF check fail, here is some solutions.