Skip to content

Instantly share code, notes, and snippets.

@demian85
Created October 18, 2012 14:18
Show Gist options
  • Save demian85/3912156 to your computer and use it in GitHub Desktop.
Save demian85/3912156 to your computer and use it in GitHub Desktop.
handlebars.js con PHP...
<?
$db = DB::getConnection();
$sql = "SELECT * FROM Projects ORDER BY name";
$data = $db->query($sql)->fetchAll();
array_walk($data, function(&$v) {
$v['enabled'] = (int)$v['enabled'];
$v['visible'] = (int)$v['visible'];
});
Response::json($data);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment