Home > Backend Development > PHP Tutorial > Analysis of automatic loading problems of classes in CI framework_php example

Analysis of automatic loading problems of classes in CI framework_php example

WBOY
Release: 2023-03-03 07:38:02
Original
815 people have browsed it

The example in this article describes the automatic loading problem of classes in the CI framework. Share it with everyone for your reference, the details are as follows:

application/config

Add in configuration file:

| 1. Packages
| 2. Libraries
| 3. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models

1. Third-party library file loading

// $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
$autoload['packages'] = array();

Copy after login

2. System class library loading

// $autoload['libraries'] = array('database', 'session', 'xmlrpc');
$autoload['libraries'] = array('database','session','form_validation','pagination','upload','curl','user_agent');

Copy after login

3. Help file loading

// $autoload['helper'] = array('url', 'file');
$autoload['helper'] = array('url','cookie','form','captcha','string','html','array','date','file','common');

Copy after login

4. Configuration file loading

// $autoload['config'] = array('config1', 'config2');
$autoload['config'] = array();

Copy after login

5. Language file loading

// $autoload['language'] = array('lang1', 'lang2');
$autoload['language'] = array();

Copy after login

6. Automatic loading of data model

//$autoload['model'] = array('model1', 'model2');
$autoload['model'] = array('');

Copy after login

Readers who are interested in more CodeIgniter related content can check out the special topics of this site: "codeigniter introductory tutorial", "CI (CodeIgniter) framework advanced tutorial", "php excellent development framework summary", "ThinkPHP introductory tutorial", "ThinkPHP Summary of common methods", "Zend FrameWork framework introductory tutorial", "php object-oriented programming introductory tutorial", "php+mysql database operation introductory tutorial" and "php common database operation skills summary"

I hope this article will be helpful to everyone’s PHP program design based on the CodeIgniter framework.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template