Create custom Input validation rules in Yii model for dependent input field

Suppose we want to create a dependent input validation rule in Yii model for dependent 2 input field. Field one is status and field two is reason. If user select a status from dropdown list then they must be fill-up reason field. If not then it will show a error message.

In model rules-

public function rules()
{
   return array(
   array(...),
   array(...),
   array('status', 'reasonValidators'),
  );
}

and validation function-

public function reasonValidators()
{
  if ((int)$this->status=="Yes")
  {
    $labels = $this->attributeLabels(); // Getting labels of the attributes
    if($this->reason=="")
    {
       $this->addError("reason", $labels["reason"]." cannot be blank.");
    }
    // More dependent on type can be written here
  }
}