Major knowledge of CodeIgniter framework (I)-php Tutorial

Source: Internet
Author: User
Key knowledge points of the CodeIgniter framework (1) CIThe framework is a lightweight and flexible framework. it does not have a lot of limitations. it also has its own encapsulation method. However, this framework is better written using native PHP syntax, unlike other frameworks, it took a long time to connect to the basic PHP syntax.

Application process:

Index. the php file acts as the front-end controller and initializes the basic resources required to run CodeIgniter. the Router checks the HTTP request to determine how to handle the request. if a cached file exists, it is directly output to the browser, you do not need to follow the following normal system process; before loading the application controller, perform security checks on HTTP requests and data submitted by any user; the controller loads models, core class libraries, helper functions, and all other resources required to process requests. The last step is to render the view and send it to the browser. if caching is enabled, the view is cached for subsequent requests.
File_exists ()
Used to check whether a file exists.
Apache mod_rewrite details:

This module provides a rewrite engine based on the regular expression analyzer to rewrite URL requests in real time. It supports a flexible and powerful URL operation mechanism for each complete rule with unlimited number of sub-rules and additional condition rules. This URL operation can depend on various tests, such as server variables, environment variables, HTTP headers, time tags, and even search databases that match URL components. This module can operate all parts of the URL (including the path information) at the server level (httpd. conf) and directory-level (. and generate the final request string. The result of this rewrite operation can be internal sub-processing, external request redirection, or even internal proxy processing. Generally, mod_rewrite is disabled by default. you need to manually enable it.

Enable query string:
 index.php?c=products&m=view&id=345

CodeIgniter also supports this format. you canApplication/config. phpEnable it in the configuration file. Open your configuration file and find the following items:

$config['enable_query_strings'] = FALSE;$config['controller_trigger'] = 'c';$config['function_trigger'] = 'm';
You only need to set the "enable_query_strings" parameter to TRUE to enable this function. Then access your controller and method through the trigger keyword you set:
index.php?c=controller&m=method

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.