Home >Backend Development >PHP Tutorial >Summary of common knowledge points of CodeIgniter, summary of codeigniter_PHP tutorial

Summary of common knowledge points of CodeIgniter, summary of codeigniter_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:50:47861browse

A summary of common knowledge points in CodeIgniter, a summary of codeigniter

This article briefly summarizes the common knowledge points in CodeIgniter development. Share it with everyone for your reference, the details are as follows:

Jump:

$this->load->helper('url');
redirect();

Constant definition:

config/constants.php

About language files:

I’ll just talk about my own approach. In order to uniformly manage error messages, I decided to make an error_lang.php

Create a new folder chinese under application/language and create a new file error_lang.php

In config.php:

$config['language']  = "english";

was changed to:

$config['language']  = "chinese";

If necessary, you can automatically load the error in autoload.php

$autoload['language'] = array('error');

error_lang.php file content

<&#63;php
$lang['error_user_login'] = "用户名或密码有误|请检查您的输入后,重新登陆";
&#63;>

When using it, use the following statement

$this->lang->load('error');
$this->lang->line('error_user_login');

Let CodeIgniter support $_GET

Solution:

1) In config.php, set ‘uri_protocol’ to ‘PATH_INFO’.

$config [ 'uri_protocol' ] = "PATH_INFO" ;

2) Add:
before you need to use $_GET

parse_str ( $_SERVER [ 'QUERY_STRING' ] , $_GET ) ;

In this way, something like index.php/blog/list?parm=hello&page=52 can be run.

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", "Summary of Common Methods in ThinkPHP", "Introduction Tutorial on Zend FrameWork Framework", "Introduction Tutorial on PHP Object-Oriented Programming", "Introduction Tutorial on PHP MySQL Database Operation" and "Summary of Common PHP Database Operation Skills"

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1133077.htmlTechArticle Summary of common knowledge points of CodeIgniter, summary of codeigniter This article briefly summarizes common knowledge points in CodeIgniter development. Share it with everyone for your reference, the details are as follows: Jump: $this-...
Statement:
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