11) CodeIgniter Source code Analysis of the controller.php

Source: Internet
Author: User

1<?phpif( !defined(' BasePath '))Exit(' No Direct script access allowed ');2 3 /**4 * CodeIgniter application Controller Class5  */6 classCi_controller {7 8  Private Static $instance;9 Ten  /** One * Constructor A   */ -   Public function__construct () -  { the   //by self:: $instance implementation of the Singleton, in the first instance, the static variable is the real reference to this instance.  - &get_instance () can be used to obtain this single instance.  -Self::$instance=&$this; -    +   //all the components that have been loaded by the current program are given to this super controller.  -   foreach(Is_loaded () as $var=$class) +   { A    $this-$var=& Load_class ($class); at   } -  -   //load the loader component for the controller, this component is its good helper, often you will use the form of $this->load->xxx () to load something, - //This load is associated with the presence of the controller when it is constructed.  -   $this->load =& load_class (' Loader ', ' core '); -  in   //initializes the loader component, detailing loader.php -   $this->load->Initialize (); to    +Log_message (' Debug ', ' Controller Class Initialized ')); -  } the  *   Public Static function&get_instance () $  {Panax Notoginseng   returnSelf::$instance; -  } the}

11) CodeIgniter Source code Analysis of the controller.php

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: info-contact@alibabacloud.com 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.