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