/
mikopbx
/
ModuleRHVoice
Обзор
Документация
Войти
/
mikopbx
/
ModuleRHVoice
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
master
App/Forms/ModuleRHVoiceForm.php
54 строки
1 KB
boffart
Вынес параметр rate как настройку.
17 мар 2025, 12:46
17 мар 2025, 12:46
c053422
Код
Авторство
О чём код?
<?php /** * Copyright (C) MIKO LLC - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential * Written by Nikolay Beketov, 9 2018 * */ namespace Modules\ModuleRHVoice\App\Forms; use Modules\ModuleRHVoice\Models\ModuleRHVoice; use Phalcon\Forms\Element\Select; use Phalcon\Forms\Element\TextArea; use Phalcon\Forms\Form; use Phalcon\Forms\Element\Numeric; use Phalcon\Forms\Element\Hidden; class ModuleRHVoiceForm extends Form { public function initialize($entity = null, $options = null) :void { $this->add(new Hidden('id', ['value' => $entity->id])); $this->add(new TextArea('text', ['rows' => 3])); $this->add(new Numeric('local_port', [ 'maxlength' => 5, 'style' => 'width: 120px;', 'defaultValue' => 8080, ])); $this->add(new Numeric('rate', [ 'maxlength' => 3, 'style' => 'width: 120px;', 'defaultValue' => 40, ])); $library = new Select( 'voice', ModuleRHVoice::getSelectVoiceData(), [ 'using' => [ 'id', 'name', ], 'useEmpty' => false, 'value' => $entity->voice, 'class' => 'ui search selection dropdown library-type-select', ] ); $this->add($library); } }