Created
February 29, 2020 00:09
-
-
Save govaniso/58e1d5bdb52cf349063572f376d73854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// core/kumbia/kumbia_view.php | |
/** | |
* Devuelve la respuesta en formato JSON | |
* application/json | |
* | |
* @param type $data | |
*/ | |
public static function json($data) | |
{ | |
View::select(null, null); | |
header('Content-type: application/json'); | |
echo json_encode($data); | |
} | |
// core/libs/input/input.php | |
/** | |
* Permite recuperar los datos en formato json | |
* @return json | |
*/ | |
public static function json() | |
{ | |
$json = file_get_contents('php://input'); | |
return json_decode($json, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment