41 lines
686 B
PHP
41 lines
686 B
PHP
<?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;
|
|
|
|
}
|
|
} |