I am trying to create my own settings form (EE5) using the documentation, but when i am using the function settings_form() & save_settings() and calling the "return ee('View')->make('my_extension:index')->render($vars);" it will not save. It displays correctly and submits the form but doesn't save. When I run the settings() function it works fine, but I need to create some custom areas. Anyone experiencing similar issues with it not saving.

  • When using custom settings methods, you need to perform the save routine yourself within save_settings(). Are you manually saving your extension settings in that method? Commented Dec 3, 2018 at 13:43
  • I am not saving them manually. I was under the impression that when the save_settings() method is called it will submit the form data automatically to the /save. I watched the data and both save_settings() and settings() are submitting the same parameters but one is saving and the other isn't. How do I save the settings manually? Commented Dec 3, 2018 at 15:27

1 Answer 1


The save_settings() method doesn't do anything with your settings data simply by existing - you need to process the submission yourself. From the docs:

Use it to process the data sent and put it into the exp_extensions database table. Remember that the data put into the database is a serialized array, so handle it appropriately.

The easiest way to do this is using the existing Extension model, which abstracts a lot of that work for you:

$model = ee('Model')->get('Extension')
    ->filter('class', ucfirst(get_class($this)))

$my_settings = array(
    'foo' => ee('Request')->post('foo'),
    'bar' => ee('Request')->post('bar')

$model->settings = $my_settings;

(Since the settings property of the Extension model is set to be serialized data, you only have to assign an array to it - the serialization will happen in the model.)

  • Thank you very much. Derek you answer was spot on! Commented Dec 4, 2018 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.