use yii\widgets\ActiveForm;
use yii\base\DynamicModel;
-$model = new DynamicModel([
- 'phones', 'channelName', 'cascadeName', 'subjectId', 'templateName'
-]);
+$model = new class(['phones', 'channelName', 'cascadeName', 'subjectId', 'templateName']) extends DynamicModel {
+ public function formName()
+ {
+ return '';
+ }
+};
$model->addRule(['phones', 'channelName', 'cascadeName', 'subjectId', 'templateName'], 'safe');
?>
<div class="test-whatsapp col-6 p-4">
-<p>
- <?= Html::a('Назад', ['index'], ['class' => 'btn btn-primary']) ?>
-</p>
+ <p>
+ <?= Html::a('Назад', ['index'], ['class' => 'btn btn-primary']) ?>
+ </p>
-<?php $form = ActiveForm::begin(); ?>
+ <?php $form = ActiveForm::begin(['method' => 'post']); ?>
<h3>Отправка сообщений</h3>
-<?= $form->field($model, 'phones')->textInput([
- 'maxlength' => true,
- 'placeholder' => 'Введите телефоны через запятую'
-]) ?>
+ <?= $form->field($model, 'phones')->textInput([
+ 'maxlength' => true,
+ 'placeholder' => 'Введите телефоны через запятую'
+ ]) ?>
<div class="form-group">
<?= Html::submitButton('Отправить сообщения', [
<hr>
<h3>Получить канал по имени</h3>
-<?= $form->field($model, 'channelName')->textInput([
- 'maxlength' => true,
- 'placeholder' => 'Введите имя канала'
-]) ?>
+ <?= $form->field($model, 'channelName')->textInput([
+ 'maxlength' => true,
+ 'placeholder' => 'Введите имя канала'
+ ]) ?>
<div class="form-group">
<?= Html::submitButton('Получить канал', [
<hr>
<h3>Получить каскад по имени</h3>
-<?= $form->field($model, 'cascadeName')->textInput([
- 'maxlength' => true,
- 'placeholder' => 'Введите имя каскада'
-]) ?>
+ <?= $form->field($model, 'cascadeName')->textInput([
+ 'maxlength' => true,
+ 'placeholder' => 'Введите имя каскада'
+ ]) ?>
<div class="form-group">
<?= Html::submitButton('Получить каскад', [
<hr>
<h3>Получить шаблон по subjectId и имени шаблона</h3>
-<?= $form->field($model, 'subjectId')->textInput([
- 'maxlength' => true,
- 'placeholder' => 'Введите subjectId'
-]) ?>
-<?= $form->field($model, 'templateName')->textInput([
- 'maxlength' => true,
- 'placeholder' => 'Введите имя шаблона'
-]) ?>
+ <?= $form->field($model, 'subjectId')->textInput([
+ 'maxlength' => true,
+ 'placeholder' => 'Введите subjectId'
+ ]) ?>
+ <?= $form->field($model, 'templateName')->textInput([
+ 'maxlength' => true,
+ 'placeholder' => 'Введите имя шаблона'
+ ]) ?>
<div class="form-group">
<?= Html::submitButton('Получить шаблон', [
]) ?>
</div>
-<?php ActiveForm::end(); ?>
-
-</div>
+ <?php ActiveForm::end(); ?>
+</div>
\ No newline at end of file