Stunden ende, einiges fertig, fehlt nicht mehr viel
Took 2 hours 31 minutes
This commit is contained in:
41
views/Apitemplate.class.inc.php
Normal file
41
views/Apitemplate.class.inc.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Apitemplate
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $response = array(
|
||||
'api-name' => 'faq-online',
|
||||
'api-version' => 1.0,
|
||||
'data' => array(),
|
||||
'success' => false
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @param array $a_response
|
||||
*/
|
||||
public function setResponse( array $a_response )
|
||||
{
|
||||
$this->response['data'] = $a_response;
|
||||
|
||||
}
|
||||
|
||||
public function getResponse()
|
||||
{
|
||||
return json_encode( $this->response );
|
||||
}
|
||||
|
||||
public function setHeaderCode( $a_code )
|
||||
{
|
||||
header("HTTP/1.1 $a_code" );
|
||||
}
|
||||
|
||||
public function setSuccess( bool $a_success )
|
||||
{
|
||||
$this->response['success'] = $a_success;
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user