Answer the question
In order to leave comments, you need to log in
How to add data to the database using AJAX?
By means of AJAX, an array of the form comes to the action
["ооо рога и копыта", "79515556677", "[email protected]", "57650"]
$payinfo = new PaymentForm();
//$payinfo[0] = $model->name_company; //[0] - название компании
//$payinfo[1] = $model->telephone; //[1] - телефон компании
//$payinfo[2] = $model->email; //[2] - email компании
//$payinfo[3] = $model->summa; //[3] - общая сумма компании
//$payinfo->save();
public function rules()
{
return array(
array('summa, telephone, email, name_company', 'required'),
array('summa, telephone', 'numerical', 'integerOnly' => true),
array('email, name_company', 'length', 'max' => 255),
array('summa, telephone, email, name_company', 'filter', 'filter' => array(new CHtmlPurifier(), 'purify')),
array('summa, telephone, email, name_company', 'filter', 'filter' => array(new StripTagsFilter(), 'clearString')),
);
}
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