How to redirect the user to another page with CodeiIgniter?

1

I'm starting with CodeIgniter and I'm having a little trouble linking the pages.

I'm doing it this way:

<li class="nav-item mr-3">
    <a class="nav-link page-scroll" href="<?php echo base_url('nomeApp/login');?>">Login</a>
</li>

My controller is like this

class Homepage extends CI_Controller{

function __construct(){
    parent::__construct();
    $this->load->helper('url');
}

public function index()
{
    $this->load->view('veloxmob/index');
}

public function login()
{
    $this->load->view('login/login');
}}
    
asked by anonymous 11.04.2018 / 03:19

1 answer

2

In this your tag is being redirected to the controller name App, however its controller is Homepage

try replacing the APp name for Homepage in the

<li class="nav-item mr-3">
    <a class="nav-link page-scroll" href="<?php echo base_url('Homepage/login');?>">Login</a>
</li>
    
11.04.2018 / 16:25