From 88a8ad187b13b36d6120eae2344fe16c3a76219d Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 7 Oct 2006 03:16:32 +0000 Subject: --- user_guide/general/ancillary_classes.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'user_guide/general/ancillary_classes.html') diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 86e210f3f..f7c4a8697 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -86,21 +86,21 @@ If you would like to use Code Igniter's classes from within your own custom clas

First, assign the Code Igniter object to a variable:

-$obj =& get_instance(); +$CI =& get_instance();

Once you've assigned the object to a variable, you'll use that variable instead of $this:

-$obj =& get_instance();

-$obj->load->helper('url');
-$obj->load->library('session');
-$obj->config->item('base_url');
+$CI =& get_instance();

+$CI->load->helper('url');
+$CI->load->library('session');
+$CI->config->item('base_url');
etc.

Note: You'll notice that the above get_instance() function is being passed by reference:

-$obj =& get_instance(); +$CI =& get_instance();

This is very important. Assigning by reference allows you to use the original Code Igniter object rather than creating a copy of it.

-- cgit v1.2.3-24-g4f1b