I want to write some data to a file whenever my model is saved, so I added the appropriate code to do this in the beforeSave
method in my model.
However, the path to save to is constructed using values from the config
loaded into the di
. In a controller this is accessible as $this->config->configVar
but $this->config
is not valid in the model (undefined property).
What is the correct way to access components setup in the di
from the model?