[eluser]skribe[/eluser]
Hey folks:
New to codeigniter and I haven't coded much in the last 10 years so my aged brain is rusty. Can I drop a longhand conditional into $this->table->add_row()?
Code:
$this->table->add_row(
if($p->gender=='1')
{'Male'} else {'Female'},
switch($p->age) {
case 0:
'17 and younger';
break;
case 1:
'18-25';
break;
default:
'Old Fart';
}
);
I'm getting
Parse error: syntax error, unexpected T_SWITCH and
T_IF errors when using longhand. Shorthand if/else work.
If I can't do this can you suggest an alternate solution?
Cheers,
skribe