Part of the EllisLab Network
   
 
Routing / Function Parametar Bug - Take Two!
Posted: 22 March 2007 02:04 PM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  17
Joined  07-02-2006

Hi!

I found another problem, which is very similar to the one from one reported on 2006-07-12 (link to the post) with function parameters and routing. The thread was old, I am using CI 1.5.2, so I reposted this.

I am using following example: http://codeigniter.com/wiki/Category:Internationalization::Internationalization_Views_i18n/

(in short, in that example url is changed from /Controller/Action/Argument/ to /Lang/Controller/Action/Argument )

And this is the problem:

For url: http://localhost/en/C/A/arg

‘en’ is successfully found as language
‘C’ is successfully found as controller
‘A’ is successfully found as action

but argument ‘arg’ is not! :(

the method ‘A’ receives its name instead of the argument. So it looks like the problem is indeed in CodeIgniter.php:216 and in hardcoded values 2 or 3.

I believe that segments index for accessing arguments should be calculated according to the real position of the arguments in the segment array and not hardcoded.

For now, of course I can ignore action parameter and just access 4th segment in the segment_array but this is not the real solution. Unfortunately I still don’t have enough knowledge of CI to tackle this problem on my own.

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: 66412 Total Logged-in Users: 29
Total Topics: 84752 Total Anonymous Users: 1
Total Replies: 454812 Total Guests: 213
Total Posts: 539564    
Members ( View Memberlist )
Newest Members:  NirCalexmuellerkizerdrixcaptainredmuffquinodligtharttechsivamDjordjesammozzazodman23