You should not access the query view.php products directly although it is possible, but that is not how it works in MVC and in the case in Codeigniter as well.
Ideally in the view file consultaProdutos.php
there should be the following instruction to deny direct access:
defined("BASEPATH") or exit("Acesso direto negado");
You must first create a Controller for products, then create a function to load this view.
class Produto extends CI_Controller {
public function consultaProdutos(){
// consultaProdutos abaixo é o nome da view
$this->load->view("consultaProdutos");
}
}
Your link will thus be used the URL Helper:
<a href="<?=site_url("produtos/consultaProdutos") ?>">Consulta</a>
The part produtos
indicates the Controller, and the part consultaProdutos
indicates the name of the action.
To load this helper use the code below or set it to auto load in autoload.php:
$this->load->helper('url');
You could also use the following link (less recommended)
<a href="index.php/produto/consultaProdutos">Consulta</a>
But you set up the controller to call him?
– Sr. André Baill