Yii2 - form validation rules - length

    
        public function rules()
        {
            return [
                ['property', 'string', 'max' => 10, 'tooLong' => 'Error message']
            ];
        }