[А3] => Array
(
[id] => А3
[name] => DVD и CD диски
[description] =>
[meta_keywords] =>
[meta_description] =>
[parent_id] =>
[enabled] => 1
[updated] => 2017-07-31 00:07:59
[categoriesUrl] => Array
(
[category_id] => А3
[url] => a3
[url_title] => dvd-i-cd-diski
[new] => 0
[description] =>
[meta_keywords] =>
[meta_description] =>
[product_name_template] => %name% - %sku%
)
)
$this->data = Category::find()->indexBy('id')->joinWith('categoriesUrl')->asArray()->all();
public function getCategoriesUrl()
{
return $this->hasOne(CategoriesUrl::className(), ['category_id' => 'id']);
}
var xhr = new XMLHttpRequest(),
myForm = document.forms.formName;
myForm.onsubmit = function(){
var formData = new FormData(myForm);
xhr.open('POST', 'path/to/handler', true);
xhr.onloadend = function(){
console.log(xhr.statusText);
}
xhr.send(formData);
myForm.reset();
}