Skip to content

Commit

Permalink
Update the example to reflect logging functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
robmiller committed May 3, 2012
1 parent ed3db6e commit 58fc72c
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions example/index.php
Expand Up @@ -2,8 +2,22 @@

require '../ham/ham.php';

$beans = new Ham('beans');
$beans->route('/', function($app) {
return "Beans home.";
});
$beans->route('/baked', function($app) {
return "Yum!";
});

$app = new Ham('example', false, 'logs/' . date('Y-m-d') . '.txt');

$app->route('/', function($app) {
$app->logger->log('Home requested');

return "Home.";
});

$app = new Ham('example');
$app->route('/', function($app) {
return "Home.";
});
Expand All @@ -13,15 +27,6 @@
'name' => $name
));
});
$app->route('/timestwo/<int>', function($app, $int) {
return $int * 2;
});
$app->route('/add/<int>/<int>', function($app, $a, $b) {
return $a + $b;
});
$app->route('/dividefloat/<float>/<float>', function($app, $a, $b) {
return $a / $b;
});

$app->route('/beans', $beans);
$app->run();

0 comments on commit 58fc72c

Please sign in to comment.