liventin/base.module.options.provider.selectbox

There is no license information available for the latest version (v1.0.1) of this package.

SelectBox option provider

Maintainers

Package info

github.com/Liventin/base.module.options.provider.selectbox

Type:bitrix-d7-module

pkg:composer/liventin/base.module.options.provider.selectbox

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-04-28 05:58 UTC

This package is auto-updated.

Last update: 2026-04-28 06:00:48 UTC


README

Bitrix Base Module

install | update

"require": {
    "liventin/base.module.options.provider.selectbox": "@stable"
}

redirect (optional)

"extra": {
  "service-redirect": {
    "liventin/base.module.options.provider.selectbox": "module.name",
  }
}

PhpStorm Live Template

<?php

namespace ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Options;


use Bitrix\Main\ObjectNotFoundException;
use Bitrix\Main\SystemException;
use Psr\Container\NotFoundExceptionInterface;
use ReflectionException;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Container;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Options\Option;
use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Service\Options\OptionsService;

class OptionSampleText implements Option
{

    public static function getId(): string
    {
        return 'sample_option_text';
    }

    public static function getName(): string
    {
        return 'Пример текстовой опции';
    }

    public static function getType(): string
    {
        return 'selectbox';
    }

    public static function getTabId(): string
    {
        return TabMain::getId();
    }

    public static function getSort(): int
    {
        return 100;
    }

    /**
     * @throws NotFoundExceptionInterface
     * @throws ObjectNotFoundException
     * @throws ReflectionException
     * @throws SystemException
     */
    public static function getParams(): array
    {
        /** @var OptionsService ${DS}srvOptions */
        ${DS}srvOptions = Container::get(OptionsService::SERVICE_CODE);
        /** @var SelectBoxProvider ${DS}provider */
        ${DS}provider = ${DS}srvOptions->getProvider(self::getType());
        return ${DS}provider
            ->setItems([])
            ->setDefault('')
            ->getParamsToArray();
    }
}