![]() |
Can someone please explain this to me - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Can someone please explain this to me (/showthread.php?tid=3597) |
Can someone please explain this to me - El Forum - 10-12-2007 [eluser]bosco500[/eluser] Can someone please explain this code to me? I was browsing through the design on the freakauth_demo, trying to understand the design. This line of code is from menu.php (view) Code: <?php $ci_uri = trim($this->uri->uri_string(), '/'); $att = ' id="active"';?> Why does every <li> have Code: <?= $ci_uri == $this->config->item('FAL_login_uri')? $att: ''?>><?=anchor($this->config->item('FAL_login_uri'), 'login')?> I realize that $ci_uri is an object being set, but what is the ? $att: '' for? Also why is substr used? Thanks for the help! Can someone please explain this to me - El Forum - 10-12-2007 [eluser]Armchair Samurai[/eluser] condtion ? expression1 : expression2 is a ternary operator. Think of it basically like and if/then/else structure. Can someone please explain this to me - El Forum - 10-12-2007 [eluser]sergitin[/eluser] hey brother try this Code: $a=1; and then apply to your code Can someone please explain this to me - El Forum - 10-12-2007 [eluser]bosco500[/eluser] [quote author="sergitin" date="1192216838"]hey brother try this Code: $a=1; and then apply to your code[/quote] Thanks to both of you. Great example |