index function in Controller not working |
[eluser]eberth[/eluser]
Hello, I am experiencing something very strange, the index function in my default controller is not being loaded automatically when accessing the controller, is there some new setting i have to change in order to reactivate the default funcionallity of the controller or is this a bug? thanks for your help.
[eluser]CroNiX[/eluser]
post the code. The "index" function will only be called if no method is in the url for that controller, or it is explicitly called. If you want something to execute no matter what method is being called, you do that in the class constructor. yoursite.com/cool_controller this will call the index method of cool_controller yoursite.com/cool_controller/index so will this yoursite.com/cool_controller/other_method index will not be called here
[eluser]eberth[/eluser]
Yeah, thats how it should work, but i dont know why it only works when loading the index function explicitly You can check it out on: http://pruebas.overflow.mx/ricoy doesnt work But http://pruebas.overflow.mx/ricoy/index Works This has never happened to me before, i've always used CI 1.7, and its the first time im using reactor, so i guess this might be a bug Which part of the code do you want me to post? The controller? Thank you
[eluser]eberth[/eluser]
Oh btw i modified the routes file in order to always load the default controller , so ricoy is only a directory and the default controller is site Here is what the system logs when you load the controller alone ERROR - 2011-04-15 06:09:15 --> 404 Page Not Found --> site/ ERROR - 2011-04-15 06:55:27 --> 404 Page Not Found --> site/
[eluser]eberth[/eluser]
here is my Site controller Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]eberth[/eluser]
I am making some experiments, I created another controller that only has the index function, which loads the home controller... it works as it should, no need to explicitly put index in the url in order to load.... so i changed my default controller to this test one and boom, it suddenly stopped working, so i guess it has something to do with the routes , This route is what i´ve always used to remove the controller from the url, Code: $route['^(?!formas|archivos).*'] = "site/$0"; and the .htaccess i´m using to remove the index.php Code: <IfModule mod_rewrite.c> somehow i think this is messing it up, any clue?
[eluser]InsiteFX[/eluser]
Well if you think it is messing it up! Take it out and see if it works... InsiteFX
[eluser]toopay[/eluser]
[quote author="eberth" date="1302898591"] This route is what i´ve always used to remove the controller from the url, Code: $route['^(?!formas|archivos).*'] = "site/$0"; Why you ALWAYS remove the controller from the url?? What for? [quote author="eberth" date="1302898591"] and the .htaccess i´m using to remove the index.php Code: <IfModule mod_rewrite.c> for .htaccess, this ussually working in (almost) any situation : Code: RewriteEngine On |
Welcome Guest, Not a member yet? Register Sign In |