Skip to content

Instantly share code, notes, and snippets.

@brunofonseca
Created November 28, 2015 13:41
Show Gist options
  • Save brunofonseca/08985972fadaa9e2cd60 to your computer and use it in GitHub Desktop.
Save brunofonseca/08985972fadaa9e2cd60 to your computer and use it in GitHub Desktop.
Controller Anuncios API
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