0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CodeIgniter4 の set_value() で値保持できない

Last updated at Posted at 2024-05-18

ただのうっかりだったのですが、気づくのに時間がかかってしまったのでメモ。

どうして

old() は使えるのに、set_value()だと値の保持ができない

原因

BaseController の initController() 内に

$this->session = \Config\Services::session();

を記載してないだけでした。

old()\Config\Services::session()を呼び出してなければ内部で呼び出してくれるため、設定忘れていても利用できたみたいです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?