Log in
Model

DefaultBackend

Magento\Catalog\Model\Attribute\Backend\DefaultBackend

What it does

This class serves as the default backend model for catalog attributes in Magento 2, extending the base EAV backend functionality.

Developers use it to ensure proper validation of catalog attribute values, particularly HTML content in WYSIWYG-enabled fields, before saving products or categories.

It automatically validates user-submitted HTML against security rules to prevent XSS attacks when attributes allow HTML on the frontend.

Public Methods

  • beforeSave()
  • validate()