Answer the question
In order to leave comments, you need to log in
Why doesn't yii see received data via POST?
yii does not see the received POST request
Controller:
class TeacherController extends ActiveController
{
public $enableCsrfValidation = false;
public $modelClass = Teacher::class;
}
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 questionAsk a Question
731 491 924 answers to any question