V
V
Vitaly2017-05-14 20:49:04
Keyboard
Vitaly, 2017-05-14 20:49:04

Why is the form's submit method called like folder for controller views (YII2)?

Hello, just today I started to study yii2, everything seemed to be normal at first, I set it up without problems, created a controller, created a view, I load all the rules in the view controller. Began to create the form, like I do everything as in docks. Here is the form:

<div class="form-wrap">

            <?php  $form = ActiveForm::begin(); ?>

                <?= $form->field($model, 'name')->textInput(['placeholder'=>'Имя'])->label(false); ?>
                <?= $form->field($model, 'email')->textInput(['placeholder'=>'email'])->label(false); ?>
                <?= $form->field($model, 'text')->textarea(['placeholder'=>'Ваше сообщение', 'rows' => '6'])->label(false); ?>
                <?= HTMl::submitButton('Отправить', ['class'=>'btn btn-primary'])?>

            <?php ActiveForm::end(); ?>

        </div>

But the pancake does not work, when sending it throws it on the main page. Then I started to inspect, to watch how the form is being built, I noticed that some 'test' is substituted in the method attribute instead of the POST method.
e96c2188fecc4a98ac4604a3af9ffa97.png
Then I realized that this is what I called the controller and, accordingly, the folder with the view.
557643bdec874c4ca16edce68224d25f.png
When I rename the controller to post and the folder with the views, respectively, everything works, the form is sent to the correct controller, but it doesn’t. What is this nonsense, can someone explain?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Stalker_RED, 2018-07-22
@Stalker_RED

Try other USB connectors.
A ps/2 keyboard from a flea market is the easiest and most RELIABLE way.
In second place in terms of simplicity is this marvel of engineering:
It's called a "usb to ps/2 adapter" and costs less than a dollar.

J
Johnny Smith, 2018-07-22
@Olek1

In other ports, connect the keyboard from the back

E
Ezhyg, 2018-07-22
@Ezhyg

Keyboard (USB) starts working only after loading Windows

In fact, earlier, but it won’t help you anyway :(.
The answer is simple - this keyboard doesn’t work like that. Recently, there are more and more such junk.
But if you still enter the BIOS from another keyboard, then ... all of a sudden (!), most often, such a keyboard will immediately work, as if nothing had happened.
Isn't there a countdown timer down there?

M
mitaichik, 2017-05-14
@mitaichik

It can't be automatic. You yourself set method = test somewhere. Look for an error in your code. Perhaps you are setting parameters with DI?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question