示例#1
0
				
				$params = [<br>
				&nbsp;&nbsp;\'opponent\' => \'John\',<br>
				&nbsp;&nbsp;\'location\' => \'Outside\',<br>
				&nbsp;&nbsp;\'outcome\'  => \'L\',<br>
				&nbsp;&nbsp;\'datetime\' => \'2015-12-07 10:00:00\',<br>
				];<br><br>
				
				$game->setId($id);<br>
				$game = GameController::edit($game, $params);<br>
			</div>
		';
        $game = new Game();
        $params = ['opponent' => 'John', 'location' => 'Outside', 'outcome' => 'L', 'datetime' => '2015-12-07 10:00:00'];
        $game->setId($id);
        $game = GameController::edit($game, $params);
        $test_data .= '<div class="bg-success pad">';
        foreach ($game as $key => $value) {
            $test_data .= $key . ' : ' . $value . '<br>';
        }
        $test_data .= '</div>';
        $body = '
			<ol class="breadcrumb">
				<li><a href="index.php">Getting Started</a></li>
				<li><a class="active">Initial Testing</a></li>
			</ol>

			<div class="row">
				<div class="col-md-8">
					<p>Now that your scripts are generated, we will test the generated code. There are a set of default queries that can be used for basic CRUD. These will be our main focus to ensure the files were setup correctly.</p>
					' . $test_data . '
示例#2
0
});
// Pelin lisääminen tietokantaan
$routes->post('/game', 'check_logged_in', function () {
    GameController::store();
});
// Pelin lisäyssivu
$routes->get('/game/new', 'check_logged_in', function () {
    GameController::create();
});
// Pelin esittelysivu
$routes->get('/game/:gameid', 'check_logged_in', function ($gameid) {
    GameController::show($gameid);
});
// Pelin muokkauslomakkeen esittäminen
$routes->get('/game/:gameid/edit', 'check_logged_in', function ($gameid) {
    GameController::edit($gameid);
});
// Pelin muokkaaminen
$routes->post('/game/:gameid/edit', 'check_logged_in', function ($gameid) {
    GameController::update($gameid);
});
// Radan poisto
$routes->post('/game/:gameid/destroy', 'check_logged_in', function ($gameid) {
    GameController::destroy($gameid);
});
// Käyttäjä
// Kirjautumislomakkeen esittäminen
$routes->get('/login', function () {
    UserController::login();
});
// Kirjautumisen käsittely