Reputation:
Here i am trying to load abous us page. But the requested page is not found.Please provide solution for this issue.
View:
<ul class="nav nav-pills">
<li><a href="<?php echo $site ?>">HOME</a></li>
<li><a href="<?php echo $site ?>/CI_timeline/loadaboutus">ABOUT US</a></li></ul>
Controller:
public function loadaboutus()
{
$data=$this->data;
$this->load->view('aboutus',$data);
}
Upvotes: 3
Views: 7772
Reputation: 23
Use
<?php echo base_url('/ContollerName/function Name') ;?>
and in your controller , add
public function loadaboutus()
{
$this->load->helper('url');
$data=$this->data;
$this->load->view('aboutus',$data);
}
Upvotes: 0
Reputation: 61
Make sure your base folder name and the name you write in $config['base_url'] is the same.
Upvotes: 0
Reputation: 226
public function loadaboutus()
{
$data=$this->data;
$this->load->view('aboutus',$data);
}
Try this:
public function loadaboutus()
{
$this->load->view('aboutus');
}
Upvotes: 1
Reputation: 60
Make sure you have written the proper controller name both in "li" and also at the top of your controller page.
Upvotes: 2
Reputation: 566
Mybe you did not add index.php
<li><a href="<?php echo $site ?>/index.php/CI_timeline/loadaboutus">ABOUT US</a></li>
or
<li><a href="<?php echo site_url() ?>/CI_timeline/loadaboutus">ABOUT US</a></li>
make sure your controller name start with capital letter.
Upvotes: 2