1. Go to this page and download the library: Download manzadey/sbuilder-xml-soap 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/ */
manzadey / sbuilder-xml-soap example snippets
use Manzadey\SBuilderXmlSoap\Plugins;
use Manzadey\SBuilderXmlSoap\Plugin;
use Manzadey\SBuilderXmlSoap\Category;
use Manzadey\SBuilderXmlSoap\Field;
use Manzadey\SBuilderXmlSoap\Element;
$plugins = new Plugins;
$plugin14 = new Plugin('pl_plugin_14');
$category1400 = new Category('1400');
$category1400->addField('cat_title', 'Раздел 1');
$category1400->addField(new Field('user_f_17', 'Наполнение для поля user_f_17'));
$category1400->addField(
static fn(Category $category) : Field => $category
->newField('user_f_19', 'Наполнение для поля user_f_19')
);
$element = new Element;
$element->addField('p_title', 'Элемент 1');
$element->addField('p_price1', '10000');
$element->addField('p_active', '1');
$element->addField('user_f_18', 'Наполнение для поля user_f_18');
$category1400->addElement($element);
$category1400->addCategory(
static fn(Category $category) : Category => $category->newCategory()
->addField('cat_title', 'Подраздел раздела 1')
->addField('user_f_17', 'Наполнение для поля user_f_17')
->addField('user_f_19', 'Наполнение для поля user_f_19')
->addElement(static fn(Category $category) : Element => $category
->newElement()
->addField('p_title', 'Элемент 2')
->addField('p_price1', '20000')
->addField('p_active', '1')
->addField('user_f_18', 'Наполнение для поля user_f_18')
->addField(static fn(Element $element) : Field => $element
->newField('user_f_4', '5')
->extId()
)
)
);
$plugin14->addCategory($category1400);
$plugins->addPlugin($plugin14);
echo $plugins->save();