PHP code example of loodsen / bx.options

1. Go to this page and download the library: Download loodsen/bx.options library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

loodsen / bx.options example snippets

`


global $USER;
global $APPLICATION;

if (!$USER->IsAdmin()) {
    return;
}

use Bitrix\Main\Loader;
use Bx\Options\Form\Element\Field\SelectField;
use Bx\Options\Form\Element\Field\TextField;
use Bx\Options\Form\Element\UI\Divider;
use Bx\Options\Form\Element\UI\Notice;
use Bx\Options\Form\Render\JsonRender;
use Bx\Options\Form\Element\Tab;
use Bx\Options\Form\TabbedForm;
use Bx\Options\Form\Validator\NotEmpty;

Loader:: new TextField("some_setting2", "Название 2"),
        new TextField("some_setting3", "Название 3"),
        new SelectField("some_select", "Город", $cityVariant)
    ),
    new Tab(
        "Логирование",
        new Notice("Заголовок", "Текст", "info"),
        new TextField("some_setting123", "Название2"),
        new SelectField("some_select2", "Город2", $cityVariant, true),
        new Divider("Разделитель2"),
    )
);

$APPLICATION->IncludeComponent("bx.options:option.form", "vue_app", [
  "UI_OBJECT" => $form,
  "NAMESPACE" => "bx.options",
]);