L
L
leafyboi2020-09-05 18:47:45
Yii
leafyboi, 2020-09-05 18:47:45

Why doesn't yii see received data via POST?

yii does not see the received POST request
5f53b20038f6b157247485.png
Controller:

class TeacherController extends ActiveController
{
    public $enableCsrfValidation = false;

    public $modelClass = Teacher::class;
}


Model:
class Teacher extends \yii\db\ActiveRecord
{
    public static function tableName()
    {
        return 'teachers';
    }

    public function rules()
    {
        return [
            [['name', 'surname'], 'required'],
            [['info', 'photo'], 'string'],
            [['name', 'surname', 'middle_name', 'gender'], 'string', 'max' => 255],
        ];
    }

    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'surname' => 'Surname',
            'middle_name' => 'Middle Name',
            'gender' => 'Gender',
            'info' => 'Info',
            'photo' => 'Photo',
        ];
    }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question