liventin / base.module.options.provider.text
Text option provider
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:bitrix-d7-module
Requires
- php: >=8.1
- liventin/base.module: ^1.0.0
Requires (Dev)
- roave/security-advisories: dev-latest
README
Bitrix Base Module |
install | update
"require": {
"liventin/base.module.options.provider.text": "^1.0.0"
}
redirect (optional)
"extra": {
"service-redirect": {
"liventin/base.module.options.provider.text": "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; use ${MODULE_PROVIDER_CAMMAL_CASE}\\${MODULE_CODE_CAMMAL_CASE}\Src\Options\Providers\TextProvider; 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 'text'; } 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 TextProvider ${DS}provider */ ${DS}provider = ${DS}srvOptions->getProvider(self::getType()); return ${DS}provider ->getParamsToArray(); } }