Welcome Guest, Not a member yet? Register   Sign In
Code logic in codeigniter
#2

If you could copy/paste the code into the forum rather than using images, it would make it a lot easier not only to read the code, but to make changes and show them to you (if you use the PHP blocks, it will even give it some decent formatting). For example:

Code:
[php]
public function questions()
{
    // ...
}
[/php]


The ternary operator might help a little with the if/else conditions in your view, but it doesn't look like there's a simple solution there, other than using a different view if $q->asker_id == 0, or breaking up the view into partial views (and using different partial views for the 0 condition).
Reply


Messages In This Thread
Code logic in codeigniter - by sebastianvirlan - 08-24-2015, 01:54 PM
RE: Code logic in codeigniter - by mwhitney - 08-25-2015, 08:55 AM
RE: Code logic in codeigniter - by cartalot - 08-25-2015, 11:38 AM
RE: Code logic in codeigniter - by mwhitney - 08-25-2015, 01:41 PM
RE: Code logic in codeigniter - by cartalot - 08-25-2015, 03:34 PM
RE: Code logic in codeigniter - by mwhitney - 08-26-2015, 08:22 AM
RE: Code logic in codeigniter - by cartalot - 08-25-2015, 08:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB