It appears from the error you have a space between $ and getLoginValidatorMsg so you need to remove that space using a correctly placed trim() or just str_replace() on the whole thing. Also, it is saying it's looking for a property so you need to add () on your $this->model->{$this->function} so it turns it to a method: