[Yii2] CSRF 表單處理 – CSRF Form Handling

原生表單加入CSRF

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

Leave a Reply

Your email address will not be published. Required fields are marked *