Part of the EllisLab Network
   
 
Changing default controller in CodeIgniter 1.6.2
Posted: 11 June 2008 01:43 PM   [ Ignore ]  
Summer Student
Total Posts:  10
Joined  04-27-2008

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.

Profile
 
 
Posted: 11 June 2008 01:50 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1239
Joined  01-07-2008

I’ve never run into this problem.  Post the route and I’ll try it out on a test setup.

 Signature 

Blog | Twitter | Coffee

Profile
 
 
Posted: 11 June 2008 03:00 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  43
Joined  02-12-2008

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”.

 Signature 

Zoe and Gavin
Gavin on PHP

Profile
 
 
Posted: 12 June 2008 01:53 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  10
Joined  04-27-2008

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:

$route['default_controller'] = "listado";
$route['scaffolding_trigger'] = "";

this is the class definition of controller listado.php:

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.

Profile
 
 
Posted: 12 June 2008 02:17 PM   [ Ignore ]   [ # 4 ]  
Sr. Research Associate
RankRankRankRankRank
Total Posts:  3157
Joined  07-14-2006

do you have an index function in the listado class?

Profile
 
 
Posted: 12 June 2008 02:24 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  604
Joined  01-13-2008

If you don’t nothing will load.

 Signature 

Yonti - Hosting Now Available
Babblemap - Moved, Please Update links.

Profile
 
 
Posted: 12 June 2008 03:51 PM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  10
Joined  04-27-2008

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 tongue laugh ....anyway thanks for paying attention (another reason to use CodeIgniter)to this newbie.

William

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 62604 Total Logged-in Users: 16
Total Topics: 77091 Total Anonymous Users: 0
Total Replies: 416307 Total Guests: 170
Total Posts: 493398    
Members ( View Memberlist )
Newest Members:  wengbaoshanGenki1gabewellsGlaucoeudj1nsehartEasyMLance SloanandrewjhscottShuvo