Core File (super Controller) Controller. php

Source: Internet
Author: User
All controllers in CI must inherit the super controller to use the CI function:/*** CI Super controller. all controller files must inherit the super CI_Controller */class

All controllers in CI must inherit the super controller to use the CI function:

/*** CI Super controller. all controller files must inherit from the super CI_Controller */class CI_Controller {// defines the static member variable private static $ instance for saving the Singleton; // The constructor public function _ construct () {// implements the singleton. in the first instance, the static variable actually references this instance. Self: $ instance = & $ this; // is_load () is CodeIgniter. record the array of loaded class names in php // All loaded components are given to the super controller foreach (is_loaded () as $ var => $ class) {$ this-> $ var = & load_class ($ class);} // load and initialize the loader component. for details, see loader. php $ this-> load = & load_class ('loader ', 'core'); $ this-> load-> initialize (); log_message ('debug ', "Controller Class Initialized");} // create a method for instantiating an object/* CodeIgniter. the function & get_instance () {return CI_Controller: get_instance ();} in php can be used to obtain this single instance */public static function & get_instance () {return self: $ instance ;}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.