[eluser]BoyBlue[/eluser]
I have this code working on a project outside of CI
(I had to replace href with *stuff* to get this to post)
Code in my *View* Page:
<ul class="navbar">
<li class="button"><a stuff="index.php">Home</a></li>
<li class="button"><a stuff="index.php?page=BlogPosts">Blog Posts</a></li>
<li class="button"><a stuff="index.php?page=Photos">Photos</a></li>
<li class="button"><a stuff="index.php?page=Issues">Issues</a></li>
</ul>
*Controller* page Code:
if($_GET['page'] == "BlogPosts"){
include("views/blogposts.php");
}else if($_GET['page'] == "Photos"){
include("views/photos.php");
}else if($_GET['page'] == "Issues"){
include("views/issues.php");
}else{
include("views/home.php");
}
****Now here is My failed attempt at CI:****
View Code:
<ul class="navbar">
<li class="button"><a stuff="index.php">Home</a></li>
<li class="button"><a stuff="index.php?page=BlogPosts">Blog Posts</a></li>
<li class="button"><a stuff="index.php?page=Photos">Photos</a></li>
<li class="button"><a stuff="index.php?page=Issues">Issues</a></li>
</ul>
Controller Code:
if ($this->input->get('page') == 'BlogPosts'){
$this->load->view('view_blog_posts');
}
elseif ($this->input->get('page') == 'Photos'){
$this->load->view('view_photos');
}
elseif ($this->input->get('page') == 'Issues'){
$this->load->view('view_issues');
}
else{
$this->load->view('view_home');
}
The error that I'm getting is *404 Page Not found*.
What am I doing wrong? Also, is there a better way to do this inside CI?
thx,
Ryan