FUEL CMS User Guide : Version 0.9.3


Utility Helper

A simple collection if helper functions designed for debugging content and echoing it out to the screen. This helper is autoloaded.

This helper is loaded using the following code:

$this->load->helper('utility');

The following functions are available:

capture('on', 'clean')

Capture content a buffer into a string and output it as needed. The clean parameter can either have the value of all, which will end and clean the output buffering, or TRUE, which will just clean the output buffering.

capture(true);

...code goes here

$str = capture(false, 'all');

echo $str;

is_true_val('val')

Determine if a string is a true value and format it as a standard true value.

$val = true;

if(($bool = is_true_val($val)) == true)
{
    ...code goes here
}

is_serialized_str('data')

Determine if a string is a serialized array

$data = serialize(array(0=>'val1', 1=>'val2'))

if(is_serialized_str($data))
{
    ...code goes here
}

print_obj('obj', 'return')

Pass an object variable and print or return the contents in human-readible format.

$obj = new Object();

$str = print_obj($object, true);

echo $str;

CI()

Returns the global CodeIgniter super object

CI()->load->model('my_model');