Can someone please explain this to me |
[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!
[eluser]Armchair Samurai[/eluser]
condtion ? expression1 : expression2 is a ternary operator. Think of it basically like and if/then/else structure.
[eluser]sergitin[/eluser]
hey brother try this Code: $a=1; and then apply to your code
[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 |
Welcome Guest, Not a member yet? Register Sign In |