mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
Changes to the FilterWidget
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user