I'm new in MVC and would like to ask about controller and routing in Codeigniter.
I do my project in my localhost.
When we call localhost/projectname, it goes to the controller Welcome which has index function to view main.
this controller, I also have another function to change to another page, like this :
public function index()
{
$this->load->view('main');
}
public function changeLanguage(){
$this->load->view('main_in');
}
}
How can I move to do a href in the view. In my main.php (view). I have :
<a href="changeLanguage">Link</a>
But it's not working. Then I change the link to :
<a href="index.php/Welcome/changeLanguage">Link</a>
and it's working. But on the second view (main_in.php). I want to make a link to go back to the first place. I call it but got error 404 again. Any clues ? thanks in advance.