1
I’m starting with Codeigniter and I’m having a little difficulty 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');
}}
You need to have a controller nameApp, with the login function. In this login function, you return your view
– Sveen
Now just take the result of $this->load->view and print on the screen with echo
– Sveen
Can you show me an example ? Because it’s being a little confusing since I’m starting now in the code, this echo I insert inside my controller or link ?
– Mike Otharan
echo $this->load->view('veloxmob/index'); will print the veloxmob index.php folder (inside the views folder)
– Sveen