A summary of common knowledge points of CodeIgniter and a summary of codeigniter
This article briefly summarizes common knowledge points in CodeIgniter development. We will share this with you for your reference. The details are as follows:
Jump:
$this->load->helper('url');redirect();
Constant definition:
Config/constants. php
About language files:
I just decided to make an error_lang.php policy for unified error information management.
Create a folder named "chinese" in application/language and create the file "error_lang.php ".
In config. php:
$config['language'] = "english";
Modify:
$config['language'] = "chinese";
If necessary, you can automatically load the error in autoload. php.
$autoload['language'] = array('error');
Error_lang.php File Content
<? Php $ lang ['error _ user_login '] = "the user name or password is incorrect. | check your input and log on again.";?>
Use the following statement
$this->lang->load('error');$this->lang->line('error_user_login');
Enable CodeIgniter to support $ _ GET
Solution:
1) In config. php, set 'uri _ Protocol' to 'path _ info '.
$config [ 'uri_protocol' ] = "PATH_INFO" ;
2) Before using $ _ GET, add:
parse_str ( $_SERVER [ 'QUERY_STRING' ] , $_GET ) ;
This is like index. php/blog/list? Parm = hello & page = 52.