示例#1
0
         $res[] = array('id' => $data['biblio_id'], 'title' => $data['title']);
     }
     return $response->getBody()->write(json_encode($res));
 });
 /**
  * Biblio detile
  *
  * @path    /biblio/id/token
  *
  * @param   integer   id
  * @param   string    token
  *
  * @return  json
  */
 $app->get('/{id:[0-9]+}/{token}', function ($request, $response, $args) {
     $datas = Biblio::find('all', array('conditions' => array('biblio_id = ?', $args['id'])));
     $datas = toArray($datas);
     return $response->getBody()->write(json_encode($datas));
 });
 /**
  * Biblio Create
  *
  * @path    /biblio/create/token
  *
  * @param   string    token
  *
  * @return  boolean
  */
 $app->put('/create/{token}', function ($request, $response, $args) {
     /*coming soon*/
 });