Another errata for Professional CodeIgniter
(I’m on a roll here, folks. Sorry for all the notices. We had a number of last-minute changes in the code, and the chapter examples didn’t get updated….and when you look at it 300 times, you just start missing stuff.)
On page 102 the search() function contains this group of code:
if ($this->input->post('term')){
$search['results'] = $this->MProducts->search($this->input->post(’term’);
}else{
…
The use of $search['results'] is incorrect, as it should be $data['results'] instead, like this:
if ($this->input->post('term')){
$data['results'] = $this->MProducts->search($this->input->post(’term’);
}else{
…
The code is correct in the downloadable zip archive.

