0
「(」期待コントローラは、それはそれだ-_-CodeIgniterのPHP構文解析エラー、予期しない「{」でこの<strong>PHP解析エラー予期しない「{」、期待「(」</strong></p> <p>ノーバックトレース、ない他のエラーメッセージ、ちょうど1行では何
私は解決策を探していると、これに関連する多くのリンクを読み続けた。
以下の私のコードのエラーの原因になる可能性がどのような..
このは(罰金働いていた)私のコントローラのコードだった:私のページの
if (isset($filter) && !empty($search)) {
$data['users'] = $this->model_search->searchTutor($field, $search);
}
elseif (($filter == 'subjName') && !empty($search)) {
$data['users'] = $this->model_search->searchBySubj($field, $search);
}
else {
$data['users'] = $this->model_search->getlist($field);
}
//later i wanted to add a code that will show No Result Found
ビューファイルは、私は私のコントローラ(Search.php)でのelseif文を追加したときに、このエラーを与え始め:
if (isset($filter) && !empty($search)) {
$data['users'] = $this->model_search->searchTutor($field, $search);
}
elseif (($filter == 'subjName') && !empty($search)) {
$data['users'] = $this->model_search->searchBySubj($field, $search);
}
//so I added another elseif
elseif (isset($filter) && empty($search)) {
$data['users'] = $this->model_search->getlist($field);
}
//and put the No Result last
else {
$this->session->set_flashdata('nores','<div class="alert text-center">No result matched your search.</div>');
}
これは複数のelseif条件のためか、ここには何かが本当に欠けていますか?助けてください...あなたの新しいelseif
これを指摘していただきありがとうございます。私は今編集しました。しかし、なぜそれはビュー内にフラッシュデータを表示しませんか?いいえ結果をエコーするはずです... – Distro
@Distroそれはまったく別の問題であるようです。そうであれば、この問題を解決済みとしてマークし、新しい質問をしてください。 – Carcigenicate
@Distroどこであなたのフラッシュデータを見るか? –