Changes to the FilterWidget

This commit is contained in:
Paolo
2018-05-29 18:05:22 +02:00
parent dc580c9526
commit 0a71bce547
9 changed files with 2768 additions and 1923 deletions
+35
View File
@@ -20,6 +20,9 @@ class FHC_Controller extends CI_Controller
$this->load->helper('fhcauth');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Wrapper to load phrases using the PhrasesLib
* NOTE: The library is loaded with the alias 'p', so must me used with this alias in the rest of the code.
@@ -30,6 +33,9 @@ class FHC_Controller extends CI_Controller
$this->load->library('PhrasesLib', array($categories, $language), 'p');
}
//------------------------------------------------------------------------------------------------------------------
// Protected methods
/**
* Sets the unique id for the called controller
* NOTE: it is only working with HTTP GET request, not neeaded with POST
@@ -67,4 +73,33 @@ class FHC_Controller extends CI_Controller
{
return $this->_controllerId;
}
/**
* Utility method to output a success using JSON as content type
* Wraps the private method _outputJson
*/
protected function outputJsonSuccess($mixed)
{
$this->_outputJson(success($mixed));
}
/**
* Utility method to output an error using JSON as content type
* Wraps the private method _outputJson
*/
protected function outputJsonError($mixed)
{
$this->_outputJson(error($mixed));
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Utility method to output using JSON as content type
*/
private function _outputJson($mixed)
{
$this->output->set_content_type('application/json')->set_output(json_encode($mixed));
}
}