Browse Source

return options in the format Pebble expects for a menu

pull/10/head
Aaron Parecki 10 years ago
parent
commit
4837a4616d
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      controllers/controllers.php

+ 10
- 2
controllers/controllers.php View File

@ -53,8 +53,16 @@ $app->get('/new', function() use($app) {
$app->get('/new/options.json', function() use($app) {
$app->response()['Content-Type'] = 'application/json';
$app->response()->body(json_encode(array(
'Caffeine' => caffeine_options(),
'Alcohol' => alcohol_options()
'sections' => array(
array(
'title' => 'Caffeine',
'items' => array_map(function($e){ return array('title'=>$e); }, caffeine_options())
),
array(
'title' => 'Alcohol',
'items' => array_map(function($e){ return array('title'=>$e); }, caffeine_options())
)
)
)));
});

Loading…
Cancel
Save