diff options
author | Andrey Andreev <narf@devilix.net> | 2015-03-21 11:18:10 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-03-21 11:18:10 +0100 |
commit | b011716ecce4ac8f28aad08fa4ed824102ff2cd2 (patch) | |
tree | a24446a8bbc6a59adec18e3fc2f90ab5851e6b68 /user_guide_src | |
parent | 94b758651f39cb3e3af335c71473102191965aeb (diff) |
[ci skip] Remove an obsolete note about references
Close #3686
Diffstat (limited to 'user_guide_src')
-rw-r--r-- | user_guide_src/source/general/ancillary_classes.rst | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/user_guide_src/source/general/ancillary_classes.rst b/user_guide_src/source/general/ancillary_classes.rst index 6a64742ce..f1285d931 100644 --- a/user_guide_src/source/general/ancillary_classes.rst +++ b/user_guide_src/source/general/ancillary_classes.rst @@ -11,7 +11,8 @@ get_instance() .. php:function:: get_instance() - :returns: object of class CI_Controller + :returns: Reference to your controller's instance + :rtype: CI_Controller **Any class that you instantiate within your controller methods can access CodeIgniter's native resources** simply by using the @@ -44,17 +45,9 @@ Once you've assigned the object to a variable, you'll use that variable $CI->config->item('base_url'); // etc. -.. note:: You'll notice that the above get_instance() ``function`` is being - passed by reference:: - - $CI =& get_instance(); - - This is very important. Assigning by reference allows you to use the - original CodeIgniter object rather than creating a copy of it. - -Furthermore, if you'll be using ``get_instance()`` inside another class, -then it would be better if you assign it to a property. This way, you -won't need to call ``get_instance()`` in every single method. +If you'll be using ``get_instance()`` inside another class, then it would +be better if you assign it to a property. This way, you won't need to call +``get_instance()`` in every single method. Example:: @@ -80,9 +73,8 @@ Example:: { $this->CI->config->item('base_url'); } - } In the above example, both methods ``foo()`` and ``bar()`` will work after you instantiate the Example class, without the need to call -``get_instance()`` in each of them.
\ No newline at end of file +``get_instance()`` in each of them. |