Я удалила, теперь появилась другая ошибка: Call to a member function hasErrors() on null
in C:\OSPanel\domains\basic\vendor\yiisoft\yii2\widgets\ActiveField.phpat line 964
* Adds validation class to the input options if needed.
* @param $options array input options
* @since 2.0.14
*/
protected function addErrorClassIfNeeded(&$options)
{
// Get proper attribute name when attribute name is tabular.
$attributeName = Html::getAttributeName($this->attribute);
if ($this->model->hasErrors($attributeName)) {
Html::addCssClass($options, $this->form->errorCssClass);
}
}
}
2. in C:\OSPanel\domains\basic\vendor\yiisoft\yii2\widgets\ActiveField.php at line 402– yii\widgets\ActiveField::addErrorClassIfNeeded()
3. in C:\OSPanel\domains\basic\views\layouts\main.php at line 74– yii\widgets\ActiveField::textInput()
Забронировать номер
<?php $form = ActiveForm::begin(['id' => 'form-booking']); ?>
in C:\OSPanel\domains\basic\vendor\yiisoft\yii2\widgets\ActiveField.phpat line 964
* Adds validation class to the input options if needed.
* @param $options array input options
* @since 2.0.14
*/
protected function addErrorClassIfNeeded(&$options)
{
// Get proper attribute name when attribute name is tabular.
$attributeName = Html::getAttributeName($this->attribute);
if ($this->model->hasErrors($attributeName)) {
Html::addCssClass($options, $this->form->errorCssClass);
}
}
}
2. in C:\OSPanel\domains\basic\vendor\yiisoft\yii2\widgets\ActiveField.php at line 402– yii\widgets\ActiveField::addErrorClassIfNeeded()
3. in C:\OSPanel\domains\basic\views\layouts\main.php at line 74– yii\widgets\ActiveField::textInput()
Забронировать номер
<?php $form = ActiveForm::begin(['id' => 'form-booking']); ?>
<?= $form->field($bookingForm, 'name')->textInput(['placeholder' => 'Ваше имя']) ?>
<?= $form->field($bookingForm, 'pet_name')->textInput(['placeholder' => 'Имя питомца']) ?>
<?= $form->field($bookingForm, 'phone')->textInput(['placeholder' => 'Ваш телефон']) ?>
<?= $form->field($bookingForm, 'start_date')->textInput(['type' => 'date', 'placeholder' => 'Дата с']) ?>
<?= $form->field($bookingForm, 'end_date')->textInput(['type' => 'date', 'placeholder' => 'Дата по']) ?>