Welcome Guest, Not a member yet? Register   Sign In
Tutorial CI ain't working for me
#1

[eluser]Chilion[/eluser]
Sorry to bother you with these kind of question.

I'm following the CI tutorial point to point but as I come to the part where I should get a page in my browser it doesn't work.

I get a 404, but not the CI 404, its standard Chrome/Firefox/IE 404.
Tried all 3 browsers so not a browser problem, copied code exactly from tutorial, still not working.

I thought it might be the basePath in system/config/config.php so I tried alot of combinations but after all it's just on a domainname without any extra folders (http://www.hcgroup.nl/)

I've changed the names of the application and system folders, so I tried with the new name and with the old name, still no luck.

My enviroment is perfect, right PHP version etc etc.

What am I doing wrong?

My pages.php code (Controller)
Code:
<?php

class Pages extends CI_Controller
{
public function view($page = 'home')
{
   if (!file_exists('frameworkApplicatieCodeSecure/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);
}
}


Please help me! Smile

#2

[eluser]Rowan Wilson[/eluser]
works for me:

http://www.hcgroup.nl/index.php/pages/view

You'll need to create a .htaccess file if you dont want index.php.
#3

[eluser]Chilion[/eluser]
Thanks man, should be in the tutorial though ;-)
#4

[eluser]Rowan Wilson[/eluser]
agreed. Unfortunately the CI tutorial has always been way out of date IMO. I also found it quite confusing when I first started out.

Check out nettuts, they have various CI tutorials that are easier to follow:

http://net.tutsplus.com/?s=codeigniter
#5

[eluser]Chilion[/eluser]
Thanks a big deal, works like a charm.




Theme © iAndrew 2016 - Forum software by © MyBB