I have the following web service
$app->get('/alunos', function(){
require_once('db/config.php');
foreach ($db->alunos()
->order("nome")
as $row){
$data[]=$row;
}
echo json_encode($data, JSON_UNESCAPED_UNICODE); //para android
$loader = new Twig_Loader_Filesystem('views/alunos/');
$twig = new Twig_Environment($loader, array());
$template = $twig->loadTemplate('registar.php');
echo $template->render(array('data' => $data)); //para web
});
Does anyone know how I can show the correct webservice for android / web and not both.