I am using magento2. I have form with few "ui_components" fields, lets say: field1
, field2
,field3
and Save
button
How can I save values that was enter to all fields to core_config_data?
regarding core_config_data I know that I have to use this, to save data there: use Magento\Framework\App\Config\ScopeConfigInterface;
/**
* @var \Magento\Framework\App\Config\Storage\WriterInterface
*/
protected $configWriter;
/**
*
* @param \Magento\Framework\App\Config\Storage\WriterInterface $configWriter
*/
public function __construct(
....
\Magento\Framework\App\Config\Storage\WriterInterface $configWriter
.....
)
{
$this->configWriter = $configWriter;
}
and for calling method :
$this->configWriter->save('my/path/whatever', $value, $scope =ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0);
I know each of the fields have its own fieldID, but how to use it to get data from it?
and how to save each of the fields values into separate core config row?
Thanks