Magento works with a lot of dropdown fields that you can select in the forms of the application. We can see dropdowns in the configuration, product, customer, and many more pages.
Magento has a system to set the options of the dropdown and multiselect fields. Magento uses a model that returns the values and labels to render the options of a dropdown or multiselect field. These models are called source models.
In this recipe, we will see which source models Magento uses and how we can create a custom source model for a custom configuration field.
In this recipe, we will extend the
Packt_HelloWorld module that we created in the previous recipes. Make sure you have the right version installed for this recipe. ...