i'm having an issue with my php. I've been using codeigniter and the following code is returning me this error message:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: item
Filename: views/banner.php
Line Number: 37
My controller is as following:
public function __construct()
{
    parent::__construct();
    $this->auth->check();
    $this->load->database();
    $this->load->helper('url');
    $this->load->model('banner_model');
}
public function index()
{
    $dados['banner'] = $this->banner_model->recuperar_todos_banners();
    $this->load_view("banner", $dados);
}
My view:
    <? foreach ($banner as $item):?>
       <tr>
          <td><?=$item->chave?></td>
          <td><?=$item->imagem?></td>
          <td><?=$item->descricao?></td>
          <td><?=$item->link?></td>
          <td>
             <button type="button" class="btn btn-danger btn-xs">
                <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
             </button>
          </td>
       </tr>
    <? endforeach; ?>
I tested both variables using var_dump. The purpose of this code is to access a MySQL database and store the result in an array. The $banner variable is working fine and all the data is there so each position is occupied by objects, each object being a table row.
I know this question has been asked before on StackOverflow but I still couldn't figure out what's going on exactly.
 
     
     
    