Example #1
0
 function test_loadOuts()
 {
     $class = 3;
     $background = 2;
     $result = loadOuts($class, $background);
     $this->assertEquals(true, is_array($result));
 }
Example #2
0
    $util0 = $loadouts[1][0];
    $util1 = $loadouts[1][1];
    $util2 = $loadouts[1][2];
    $util3 = $loadouts[1][3];
    $util4 = $loadouts[1][4];
    $util_array = [$util1, $util2, $util3, $util4];
    return $app['twig']->render('skills.html.twig', array('maxarray' => $max_array, 'utilarray' => $util_array));
});
//bio page
//render bio page
$app->get('/bio', function () use($app) {
    return $app['twig']->render('bio.html.twig');
});
//save loadout choice to session
$app->post('/bio', function () use($app) {
    $loadouts = loadOuts($_SESSION['class'], $_SESSION['background']);
    $max0 = $loadouts[0][0];
    $max1 = $loadouts[0][1];
    $max2 = $loadouts[0][2];
    $max3 = $loadouts[0][3];
    $max4 = $loadouts[0][4];
    $max_array = [$max1, $max2, $max3, $max4];
    $util0 = $loadouts[1][0];
    $util1 = $loadouts[1][1];
    $util2 = $loadouts[1][2];
    $util3 = $loadouts[1][3];
    $util4 = $loadouts[1][4];
    $util_array = [$util1, $util2, $util3, $util4];
    $skill_choice = $_POST['skill'];
    if ($skill_choice == 1) {
        $_SESSION['skill'] = $max_array;