次のコードを使用して、検索結果のページネーションを管理しています。
if ($this->input->post('search-notes') && (is_string($this->input->post('search-notes')) || is_string($this->input->post('search-notes')))):
$this->session->set_flashdata('search-notes', $_POST['search-notes']);
$post['search-notes'] = $this->input->post('search-notes');
elseif ($this->session->flashdata('search-notes')):
$this->session->set_flashdata('search-notes', $this->session->flashdata('search-notes'));
$post['search-notes'] = $this->session->flashdata('search-notes');
endif;
if (isset($post['search-notes']) && is_string($post['search-notes']) && !empty($post['search-notes'])):
...
これらはすべて私の開発用コンピューターでは問題なく動作しますが、実際の Web サイトでは機能しません。最終if()
ステートメントは true と評価されません。
ただし、最終ステートメント$post['search-notes']
の前または内部で変数をエコーアウトすると、機能します!if()
それはまったく奇妙で、これまでにそのようなものに遭遇したことはありません。
CodeIgniter 2.0 を使用しています
set_flashdata()
余談ですが、元のタイトルには「 CodeIgniterの機能に関する問題」というより具体的な内容がありました。しかし、刺激的で過度なモデレーション ルールが原因で、あまり意味のないものに骨抜きにする必要がありました。