Basic knowledge of the CI framework process in PHP

Source: Internet
Author: User
Tags codeigniter

CI Framework is a rapid development framework of PHP, I am the current company project background language with PHP, because I do the front-end development, need to use PHP to populate the page data, so began to understand the framework, learning some PHP and database things, This article introduces the CI framework first, I use the CI2.0 framework.

1, to codeigniter the website download compressed package, website: http://codeigniter.org.cn/download.

Note: Download 2.0 or 3.0 may have different ways to use. So you need to teller the corresponding manual to understand. Manual URL: Http://codeigniter.org.cn/docs.

2, download to local after decompression. After pressurization, the following folders are used:

The main application and system folders of the 3.CI framework are placed under the folder you want to put in.

4, we know to run PHP, requires Apache to run to parse the run. Apache is a Web server software. To install Apache software is very troublesome, so you can use an integrated software, Phpstudy, this software has a MySQL database, you can directly without configuration can be used.

5. Turn on Phpstudy, then right-click phpstudy-"Open configuration file-" vhosts-conf file. Open the vhosts-conf file, configure the domain name access as shown, then save and restart Phpstudy.

6. Open the host file for configuration. As shown

After everything is configured, enter the domain name +index.php in the address bar of the browser to access, for example my is: http://www.test.com/index.php, and then you can see that the CI Framework is used successfully as shown.

7, the role of folders under the application folder:

8. If the file you want to create is not placed in the CI application directory, you can copy all the files under the application directory to the new directory you created, but the directory created must be the same level as the application directory.

9, if you want to hide the URL in the index.php, you can do the following:

By default, URLs in CodeIgniter are designed to be friendly to search engines and humans. Unlike using the standard query string method, CodeIgniter uses a segment-based approach:

example.com/news/article/my_article

Note: URLs in the form of query strings are optional and are described below.

URI segment

Based on the model-view-Controller pattern, this URL segment is typically represented in the following form:

example.com/class/function/ID//分段url代表:http://example.com/[控制器类名]/[控制器方法名]/[所需参数]

    1. The first paragraph represents the call to the Controller class .
    2. The second paragraph represents a function or method in the calling class.
    3. The third and more segments represent parameters passed to the controller, such as an ID or various other variables.

The URI class and the function in the URL helper function can make your URI easier to work with. In addition, using the URI routing feature allows you to redirect your URLs for greater flexibility.

A basic understanding of the CI framework process in PHP

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.