If statements in Controller?

#6
[eluser]jedd[/eluser]
Okay, two things.

First, start using a constructor - as per the template code shown in the manual for controllers. Otherwise it'll bite you really soon when you start using CI classes.

Second, and it's what is causing your problem here - index() should not be the parent to the other functions or methods you are using there.

index() typically is empty or remaps back to the main or default function you have in your controller - simply because of the ambiguity of taking parameters to index() versus using a different method name (they both look the same in the URL).

Now, when you hit the url products/shoes/sandals/123 - it's looking for Products controller (which it can find) and then the shoes method (which it can't). So, 'lift up' shoes a level, so that it's peer of the index() method.


Messages In This Thread
If statements in Controller? - by El Forum - 10-20-2009, 12:27 PM
If statements in Controller? - by El Forum - 10-20-2009, 12:33 PM
If statements in Controller? - by El Forum - 10-20-2009, 01:19 PM
If statements in Controller? - by El Forum - 10-20-2009, 01:37 PM
If statements in Controller? - by El Forum - 10-21-2009, 09:47 AM
If statements in Controller? - by El Forum - 10-21-2009, 11:03 AM
If statements in Controller? - by El Forum - 10-21-2009, 12:31 PM
If statements in Controller? - by El Forum - 10-21-2009, 03:24 PM
If statements in Controller? - by El Forum - 10-22-2009, 06:13 AM
If statements in Controller? - by El Forum - 10-22-2009, 08:46 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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