示例#1
0
/**
 * @route /
 * @view /views/index.html
 */
function index()
{
    global $response;
    if (isset($_SESSION['combat']) && $_SESSION['combat']->statut != Combat::STATUT_FIN) {
        return $response->redirect('combat');
    }
    $pokemons = Pokemon::getFree();
    $context = array('pokemons' => $pokemons, 'selection' => null);
    if (isset($_SESSION['pkmn1'])) {
        $context['selection'] = $_SESSION['pkmn1']->id;
    }
    return $context;
}