• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing default controller in CodeIgniter 1.6.2

#1
[eluser]wcaicedo[/eluser]
Hi guys, i have this strange thing going on with CodeIgniter 1.6.2...when i change routes.php to specify a new default controller i get a blank page...not an error page but a blank one.

I tried leaving blank the name of the default controller class in routes.php and when i reloaded, an error message appeared as expected. I double checked my routes.php, my controller name and nothing...an the wierdest part is that i also changed default controller in a 1.6.1 instalation i have in the same machine and everything worked OK...any ideas what i'm doing wrong? thanks in advance.

#2
[eluser]Pascal Kriete[/eluser]
I've never run into this problem. Post the route and I'll try it out on a test setup.

#3
[eluser]Gavin Blair[/eluser]
Could it be that your controller has a syntax error in it? Or routes.php?

A blank page usually means syntax error. If your IDE doesn't do syntax checking, you can open up a terminal window and do "php -l filename.php".

#4
[eluser]wcaicedo[/eluser]
I have to say that i don't usually post in forums, but quite frankly i'm very impressed with your response time guys, thanks a lot!!!!!
This is the route to codeigniter:
http://localhost/dev/moo/CodeIgniter_1.6.2

Here's the relevant part of my routes.php:
Code:
$route['default_controller'] = "listado";
$route['scaffolding_trigger'] = "";

this is the class definition of controller listado.php:
Code:
class Listado extends Controller {
    function Listado(){
        parent::Controller();
        $this->load->helper('url');
        
        
    }
notice that i've tried in routes.php both "Listado" and "listado",that's because the user guide says that the first letter should be uppercase, but default configuration shows controller "welcome" or something like that, and it's not uppercase.

I don't think it's something related to a syntax error 'cause i just moved the controller and the view to CodeIgniter 1.6.1 and worked flawlesly...any ideas?

Thanks in advance.

#5
[eluser]xwero[/eluser]
do you have an index function in the listado class?

#6
[eluser]Tom Glover[/eluser]
If you don't nothing will load.

#7
[eluser]wcaicedo[/eluser]
yes, i have a idex function...
I was in my way to copy it into this post when i decided to give it one more try...i pointed my browser to: http://localhost/dev/moo/CodeIgniter_1.6.2/index.php/, and it worked fine...i dont know why(i'll keep diggin') but it's working as it should...almost certain it was my fault :-P ....anyway thanks for paying attention (another reason to use CodeIgniter)to this newbie.

William


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.