Welcome Guest, Not a member yet? Register   Sign In
How to redirect to index page
#1

[eluser]greedyman[/eluser]
In the index function of the default controller file, I putted some codes:

Code:
public function index() {
            $this->load->model('product_model');
            
            $data['new_products'] = $this->product_model->get_new_products();
            $data['categories'] = $this->product_model->get_categories();
            
            $this->load->view('user/welcome', $data);
}

In router.php:

Code:
$route['welcome'] = "user/index";

And I have a link like this, it's putted in other page (not in index page): < href="welcome">Home page</>. When I click Home Page link, I can't redirect to welcome page use index function. I try use other router,
Code:
$route['welcome'] = "user/welcome";

public function home() {
            $this->load->view('user/welcome');
}
but both way are not work as I want, the page directs to http://localhost/xampp/. How I fix it? Thanks so much!


Messages In This Thread
How to redirect to index page - by El Forum - 02-23-2013, 10:10 AM
How to redirect to index page - by El Forum - 02-23-2013, 02:38 PM
How to redirect to index page - by El Forum - 02-23-2013, 08:33 PM
How to redirect to index page - by El Forum - 02-24-2013, 07:28 AM
How to redirect to index page - by El Forum - 02-24-2013, 09:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB