I am working on a simple game where the user will randomly be generated a bingo board. Once they initialize the game (i.e. round 1 after clicking "start" on index.php), the code starts using a new controller (bingo_play.php). This controller tracks the tiles that have been marked and the information in each tile.
Here's the code:
$card['products'] = array(
1 => 'hamburger',
2 => 'fries',
3 => 'soda',
4 => 'taco',
5 => 'bacon',
6 => 'onions',
// etc.
);
if ($card['card_number'] == 1)
{
$card['card_entries'] = array(
'a1' => '2',
'b1' => '8',
'c1' => '11',
'a2' => '9',
'b2' => '14',
'c2' => '1',
'a3' => '16',
'b3' => '15',
'c3' => '23'
);
}
I suppose I could assign them as session data, but didn't think that would be the best move. Not really sure as I'm brand new to Codeigniter. In just a normal PHP project, I probably would just run an include() to the function.
My question is, what is the best way to make the tiles' id and text available through multiple function calls without having to check and assign the array in each function?