Firstly your question is very vague.
You need to first understand tha Helpers and Libraries are two separate entities within the framework
Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular category. There are URL Helpers, that assist in creating links, there are Form Helpers that help you create form elements, Text Helpers perform various text formatting routines, Cookie Helpers set and read cookies, File Helpers help you deal with files, etc.
And libraries is usually a class thats a collection of methods to handle a specific task, witch is why i think libraries are what your looking for.
You can create a library file within application/libraries
of your application directory and create a file called MyRequest.php
, the contents of that file would be like so..
class CI_MyRequest
{
//..
}
The file name and the class name are relative so they must be the same, loading the library from a controller is simple
class Index extends Controller
{
public function __construct()
{
$this->library->load('MyRequest');
}
public function index()
{
if($this->MyRequest->isAjax())
{
//.. Send me some json.
}
}
}
Note: haven't touched CI for long time so code may not be exact.