CodeIgniter Common Knowledge Point Summary _php Example

Source: Internet
Author: User
Tags autoload constant definition codeigniter zend framework

This paper briefly sums up the common knowledge points in the development of CodeIgniter. Share to everyone for your reference, specific as follows:

Jump:

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

Constant definition:

config/constants.php

About language files:

Just say my own way. To unify management error information decide to make a error_lang.php

Create a new folder under Application/language Chinese new file error_lang.php

In the config.php:

$config [' language ']  = "中文版";

Modified into:

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

You can load the error automatically in autoload.php if you need to.

$autoload [' language '] = Array (' ERROR ');

error_lang.php File Contents

<?php
$lang [' error_user_login '] = "username or password is wrong | Please check your input after landing again";
? >

When used, use the following statement

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

Let CodeIgniter support $_get

Solution:

1 in config.php, the ' Uri_protocol ' is set to ' Path_info '.

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

2 before you need to use $_get, add:

Parse_str ($_server [' query_string '], $_get);

This way, the shape like index.php/blog/list?parm=hello&page=52 can be run.

More interested in CodeIgniter related content readers can view the site topics: "CodeIgniter Introductory Course", "CI (CodeIgniter) Framework Advanced Course", "PHP Excellent Development Framework Summary", "thinkphp Introductory Course", " Thinkphp Common Methods Summary, "Zend Framework Introduction Course", "PHP object-oriented Programming Introduction Course", "Php+mysql Database operation Introduction Tutorial" and "PHP common database Operation Skills Summary"

I hope this article will help you with the PHP program design based on CodeIgniter framework.

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.