Created
November 28, 2015 13:41
-
-
Save brunofonseca/08985972fadaa9e2cd60 to your computer and use it in GitHub Desktop.
Controller Anuncios API
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
public function create(){ | |
/* | |
* URI: api/anuncios/create | |
* METHODO: POST | |
* FORMATO : form-data | |
*/ | |
$json_params = json_decode(file_get_contents('php://input')); | |
print_r($json_params); | |
die; | |
$anuncio = new Anuncio(); | |
$result = $anuncio->create($json_params[0]); | |
if($result){ | |
echo "Anuncio salvo com sucesso."; | |
}else{ | |
echo "Ocorreu um erro ao cadastrar usuario..."; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment