If statements in Controller?

#1
[eluser]industrial[/eluser]
No need to say that i am new @ CI development. You have probably figured that put by my title Smile

Can i use any kind of if/else statements in a controller?

Like following example, based on the shoe-sandal id example shown in user guide (http://ellislab.com/codeigniter/user-gui...passinguri )

Here comes the code:

Code:
<?php
class Products extends Controller {

    if (empty($sandals) && empty($id))
    {    
        echo('in else');
    }
    
    else
    {
        function shoes($sandals, $id)
        {
            echo $sandals;
            echo $id;
        }    
    }
    
}
?>


Thanks a lot!


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.