mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-23 01:46:27 +02:00
Update descartes framework to improve env.php constants handling
This commit is contained in:
parent
cf4dd2f075
commit
6321899e02
7 changed files with 48 additions and 40 deletions
|
@ -91,21 +91,21 @@
|
|||
|
||||
/**
|
||||
* Cette fonction permet de faire un retour sous forme de json
|
||||
* @param array $data : Les données à retourner sous forme de json
|
||||
* @param array $datas : Les données à retourner sous forme de json
|
||||
* @param boolean $secure : Défini si l'affichage doit être sécurisé contre les XSS, par défaut true
|
||||
* @return ApiController : On retourne l'API controlleur lui meme pour pouvoir chainer
|
||||
*/
|
||||
public function json ($data, $secure = true)
|
||||
public function json ($datas, $secure = true)
|
||||
{
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if ($secure)
|
||||
{
|
||||
echo htmlspecialchars(json_encode($data), ENT_NOQUOTES);
|
||||
echo htmlspecialchars(json_encode($datas), ENT_NOQUOTES);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo json_encode($data);
|
||||
echo json_encode($datas);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue