I have an issue which I don't know if it's related to DMZ or CI in general.
This controller function is sometimes called twice, and I have no clue what causes it?
Code:
function sell($char_id, $item_id){
// get character and item
$char = new Character(); $char->get_by_id($char_id);
$item = new Item(); $item->get_by_id($item_id);
// payout 10 gold to character
$char->add_gold(10);
// save character and delete item
$char->save();
$item->delete();
redirect('/ui/shop/'.$char->id);
}
I can add this to avoid the function being called twice, but I still don't understand why it doesn't work...