I am using a source model for fields of the configuration.
I want to get all product attributes (no matter the product or the attribute set) in this source model.
Magento 2 – How to Get All Attributes in Source Model
magento2source-model
Related Topic
- Magento – Standard Way to Load Source Model of Product Attributes
- Magento – How to use a custom source model for a multiselect product attribute in Magento 2
- Magento 2 – How to Create Multiselect with Source Model in UI Component
- Magento – Magento2: Custom source model – Class does not exist
- Magento 2 – Add Custom Select to Customer Source Model
- Magento2 Customer Template Customer-Account Select – How to Get Select Options in Template from Attribute Source Model
Best Answer
Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory;
Magento\Eav\Model\Entity\Attribute;
pass the AttributeCollectionFactory to your constructor.
ex :
and add this function.