- Added helper message with the functions success and error

- Added methods _success and _error to classes FHC_model and APIv1_Controller
This commit is contained in:
paolo
2016-06-16 12:15:52 +02:00
parent 6536ff155c
commit 0c2c0468af
3 changed files with 59 additions and 17 deletions
+22 -2
View File
@@ -7,10 +7,30 @@ class APIv1_Controller extends REST_Controller
function __construct()
{
parent::__construct();
//$this->load->library('session'); // -> autoload
//$this->load->library('database'); -> autoload
$this->load->helper('Message');
}
/** ---------------------------------------------------------------
* Success
*
* @param mixed $retval
* @return array
*/
protected function _success($retval, $message = null)
{
return success($retval, $message);
}
/** ---------------------------------------------------------------
* General Error
*
* @return array
*/
protected function _error($retval, $message = null)
{
return error($retval, $message);
}
/**
*
* @param type $data