I have a form in the store -> configuration what I've created in my system.xml
.
Before save I want to validate it. When an error happens, I want to inform the user what field was not valid.
How can I read out the label of the field from a Magento\Framework\App\Config\Value
in the beforeSave
method?
Now I can read out like this:
$label = $this->getData('field_config')['label'];
But is this the proper way to get the label? Isn't there a method or cleaner way to do it?
frontend_model
to show 2 fields. This 2 fields are in one row, I have a set of theese. I need to get a name and a hexa color for css. When I validate in thebackend_model
, I want to show what was the label of the bad value(s).