0
Hello, I created a controller that calls a function with a variable in the index, Mechi in the route works perfectly, only now I created another function within this same controller and it does not work, whenever I call the second function it falls straight into the index. How do I call the second function of this controller? , if you can help me thank.
My controller Home:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Home extends CI_Controller {
public function __construct(){
parent::__construct();
$this->load->model('painel_model');
}
public function index($meta_link=NULL)
{
if (!$meta_link) {
redirect('/', 'refresh');
}
//informações da pagina
$data['titulo'] = $produto->nome_produto;
$data['dados_painel'] = $query;
$data['view'] = 'painel/software/info';
$data['produto'] = $produto;
$data['fotos'] = $this->painel_model->getFotos($produto->id);
//carrego template
$this->load->view('painel/software/template', $data);
}
public function checkout()
{
//Dados da loja
$query = $this->painel_model->getDadosPainel();
//menu topo
$data['categorias'] = $this->painel_model->getCategorias();
//informações da pagina
$data['titulo'] = 'Checkout';
$data['dados_painel'] = $query;
$data['view'] = 'painel/checkout/baixar';
//carrego template
$this->load->view('painel/checkout/template', $data);
}
}
My Routes:
//toras pagina home
$route['home/(:any)'] = 'home/index/$1';
If I call the Function index, it works perfect, now if I call the checkout it doesn’t work, it keeps returning the index, how do I call the checkout by route? If you can help me, thank you.
I made some logical changes worked with your tips. Valew friend
– Ragnar