yupe\components\validators\YSLugValidator::validateAttribute PHP Method

validateAttribute() public method

public validateAttribute ( CModel $object, string $attribute )
$object CModel
$attribute string
    public function validateAttribute($object, $attribute)
    {
        $value = $object->{$attribute};
        if (preg_match('/[^a-zA-Z0-9_\\-]/', $value)) {
            $message = $this->message !== null ? $this->message : Yii::t('YupeModule.yupe', '{attribute} have illegal characters');
            $this->addError($object, $attribute, $message);
        }
    }
YSLugValidator