Newbie trying to figure CodeIgniter out |
[eluser]Quziz[/eluser]
Hi guys!! Ive been reading, watching tutorials on how to get started. firstly i have created a controller and named/saved it as helloworld.php in the coltrollers directory. whenever i try to view the file, i am always greeted with the welcome page, unless if i delete it which gives a 404 error. Any ideas? Thanks
[eluser]erik.brannstrom[/eluser]
What does your controller and view look like? And how are you trying to access the controller (i.e. the URL)?
[eluser]Quziz[/eluser]
i'm using abyss web server, as i prefer to use this locally than apache. not sure if that could be the problem? if i view http://localhost/index.php/hello , i see the welcome page. my hello.php controller looks as follows: <?php class hello extends Controller { function index() { echo "hello world!"; } } ?> i just noticed you said view, does that have to be a view? thanks - quziz
[eluser]erik.brannstrom[/eluser]
I doubt using Abyss should affect the results. You should use uppercase for the first letter in your controller class name. And using a view to display your pages is highly recommended, but not necessary, but echoing is very useful for testing and debugging (which basically is what you're doing).
[eluser]erik.brannstrom[/eluser]
Is the file called hello.php or helloworld.php (you've said both). It should be hello.php If that's not the problem, it's very strange.. Have you set all the config settings, such as $config['base_url']?
[eluser]Quziz[/eluser]
now when i go to the url i get Fatal error: Class 'Controllers' not found in silly me, i had typed controller's' thanks for your help! its working. |
Welcome Guest, Not a member yet? Register Sign In |