CodeIgniter doesn't load |
[eluser]Unknown[/eluser]
I started with codeIgniter today, and I'm following the beginner tutorial from phpacademy. Right now i got an odd problem. i got the following very simple controller: Code: <?php if ( ! defined('BASEPATH')) exit("No direct script access allowed"); It always loads the index function fine. When i test it, it echo's whatever i want it to echo. But when i call the other functions nothing happens. I didn't setup my .htacces yet, but when i visit the following adress: http://localhost:8899/index.php/site/home it doesn't load the home function. same goes for the other function ("about" and "test"); When i call one of the functions ("home", "about" and "test") from within the index() function it does call it how it should: Code: class Site extends CI_Controller { I'm not quite sure what is going wrong here. Hopefully someone can guide me in the right direction!
[eluser]Tpojka[/eluser]
Set constructor method too before all other methods and see what will happen: Code: public function __construct()
[eluser]InsiteFX[/eluser]
Try setting up a route to it. Code: $route['site/(:any)'] = 'site/$1';
[eluser]Unknown[/eluser]
Thanks for the reply's! i found out the problem. For some reason screwed with the: Code: $config['uri_protocol i had: Code: $config['uri_protocol'] = 'QUERY_STRING'; i has to be: Code: $config['uri_protocol'] = 'AUTO'; So this was the reason it wasn't calling my functions through the url's. |
Welcome Guest, Not a member yet? Register Sign In |