Book Image

Magento 2 Development Cookbook

Book Image

Magento 2 Development Cookbook

Overview of this book

With the challenges of growing an online business, Magento 2 is an open source e-commerce platform with innumerable functionalities that gives you the freedom to make on-the-fly decisions. It allows you to customize multiple levels of security permissions and enhance the look and feel of your website, and thus gives you a personalized experience in promoting your business.
Table of Contents (18 chapters)
Magento 2 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding configuration parameters


When you want to save some configuration parameters for your module, you can use the Magento configuration table to save your configuration in it. You can find all the configuration forms under Stores | Configuration in the Magento backend. In this recipe, we will add an extra page with some configuration parameters.

Getting ready

Like the previous recipes in this chapter, we will build further on the module that we have created in the previous recipes. Make sure you have the module files installed.

How to do it...

The following instructions describe what you have to do when you want to add some custom configuration parameters:

  1. The system configuration is always configured in the system.xml file of the module. So create the file app/code/Packt/HelloWorld/etc/adminhtml/system.xml with the following content:

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config...