Answer the question
In order to leave comments, you need to log in
How to create a simple module for Bitrix?
Hello. Created a module, everything works fine. In the code, for example, there is a variable $key = 1234;
The value that I accordingly set already in the code itself. How can you make a simple form with fields so that you do not manually enter values for variables in the code, but from the admin panel? Thanks
Answer the question
In order to leave comments, you need to log in
To have a simple form with fields, for example, in the Settings section - your module must have an options.php file (responsible for displaying settings)
---
1. create a regular form in this file ()
2. specify the submit method for the form, for example , POST
3. add a submit button to the form
4. then "catch" the POST array
5. extract the parameter values from the POST and use the Option::set method to save the parameter to the database ( https://dev.1c-bitrix. ru/api_d7/bitrix/main/config...
6. further, you can get the required parameter anywhere in the code using Option::get ( https://dev.1c-bitrix.ru/api_d7/bitrix/main/config ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question