Monday, January 13, 2020

Kartik editable column in Yii2 advanced

if(Yii::$app->request->post('hasEditable'))
{
$branchId = Yii::$app->request->post('editableKey');
$branch = Branchs::findOne($branchId);

$out = Json::encode(['output' => '', 'message'=>'']);
$post = [];
$posted = current($_POST['Branches']);
$post['Branches'] = $posted;
if($branch->load($post))
{
$branch -> save();
$output = 'my values';
$out = Json::encode(['output' => $output, 'message' => '']);
}
echo $out;
return;
}

No comments:

Post a Comment