php - CI Instances function -


I was looking for a post here that help me to learn the CI variables and examples for globalization. I could get this great post.

The problem with this is that when I tried to do it in my own application, I got the following error.

  Fatal error: Call  

in undefined function CI () on line 6 ... / application / core / MY_Controller.php I'm not sure Is that why is it that someone can expand on that?

  & lt ?? Php if (define ('basepace')) exit ('no direct script entry is allowed'); Class MY_Controller CI_Controller {Public $ Module; Public function __ composition () {origin: __ creation (); CI () - & gt; Module = $ this- & gt; Module = $ this- & gt; Router- & gt; Fetch_module (); } Function ci () {static $ CI; Released ($ CI) || $ CI = CI_Controller :: get_instance (); Return $ CI; }}  

You are defining the function in your class, so referring to you As an example method, it must be

  $ this-> ci () -> gt; Module = $ this- & gt; Module = $ this- & gt; Router- & gt; Fetch_module ();  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -