Answer the question
In order to leave comments, you need to log in
Why does a Yii2 view take a long time to render when using activeform?
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>
<?php $form = ActiveForm::begin(['id' => 'test-form']); ?>
<?= $form->field($hostnames, 'test')->input('test')?>
<?= Html::submitButton('Submit') ?>
<?php ActiveForm::end(); ?>
Answer the question
In order to leave comments, you need to log in
Why, the view takes a long time to render for you xs, but I had a long connection to the database
Try changing the form, for example:
<?php $form = ActiveForm::begin(['id' => 'test-form']); ?>
<?php ActiveForm::end(); ?>
On the standard advanced application, I froze. There are 3 queries per page.
site/index -> 8ms/9ms/13ms
site/contact -> 13ms/12ms/15ms
site/login -> 10ms/13ms/10ms.
maybe due to the fact that ActiveForm additionally pulls up assets that are copied to assets + loaded on the page.
I don't remember if he did or not though.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question