I am new to yii2, so in yii2 basic how to view and update records without id value in the url during CRUD
Code:
public function actionView($id)
{
$model = $this->findModel($id);
return $this->render('view', [
'model' => $model
]);
}
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['index']);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}