Welcome Guest, Not a member yet? Register   Sign In
Tutorial Error
#1

[eluser]CTheTech[/eluser]
On the first part of the tutorial the static pages. I get a 404 constantly.
I'm running XAMPP on Windows 7.
Here is my code for pages.php

"
class Page extends CI_Controller {
public function view($page = 'home')
{
/*if (!file_exists(APPPATH. '/views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}*/

$data['title'] = ucfirst($page); // Capitalize the first letter

$this->load->view('templates/header', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);

}
}
"
It is located in /application/controllers
My other pages are located in
application/views/templates/footer.php
application/views/templates/header.php
application/views/pages/about.php
application/views/pages/home
#2

[eluser]pettersolberg[/eluser]
If your controller is really called "pages.php" consider renaming it to "page.php" (as the class name within that file).
#3

[eluser]CTheTech[/eluser]
That's worked thanks a lot. I'm hoping to get the hang of this Framework. They should change that in the tutorial.




Theme © iAndrew 2016 - Forum software by © MyBB