<form method="post"> <input type="hidden" name="<?= Yii::$app->request->csrfParam; ?>" value="<?= Yii::$app->request->csrfToken; ?>" /> <button type="submit"> Save </button> </form>