Php ci framework process basics

Source: Internet
Author: User
The CI framework process of PHP is basically familiar with the CI framework. it is a fast development framework of PHP. I am currently using PHP in the background language of the company's projects, because I am doing front-end development, the page data needs to be filled with php, so I started to understand this framework and learned something about php and database. This article first introduces the CI framework. I use the CI2.0 framework.

1. download the compressed package from the codeIgniter website.

Note: the download method 2.0 or 3.0 may be different. So you need to read the corresponding manual. Manual URL: http://codeigniter.org.cn/docs.

2. download the package locally and decompress it. After pressurization, the folder is used as follows:

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

4. we know that Apache is required to run php for parsing. Apache is a WEB server software. Installing Apache software on your own is very troublesome, so you can use an integrated software, phpStudy. this software has a mysql database and can be used without configuration.

5. enable phpStudy and right-click phpStudy-open the configuration file-vhosts-conf file. Open the vhosts-conf file, configure domain name access, as shown in, save and restart phpStudy.

6. open the host file for configuration. As shown in

After all the configuration is complete, enter the domain name + index. php in the address bar of the browser to access the site. for example, if my website is http://www.test.com/index.php, then you can see that the ciframe has been successfully used.

7. roles of folders in the application folder:

8. if the file you want to create is not stored in the CI application directory, you can copy all the files in the application directory to the new directory you created, however, the created directory must be at the same level as the application directory.

9. if you want to hide index. php in the url, perform the following operations:

By default, URLs in CodeIgniter are designed to be friendly to search engines and humans. CodeIgniter usesSegment-basedMethod:

Example.com/news/article/my_article

Note:The URL in string format is optional and is described as follows.

URI segment

According to the model-view-controller mode, the URL segment is generally expressed as follows:

Bytes

  1. The first section indicates calling the controller.Class.
  2. The second part indicatesFunctionOr method.
  3. The third and more segments represent the parameters passed to the controller, such as ID or other variables.

Functions in the URI class and URL helper functions can make your URI easier to work. In addition, you can use the URI routing feature to redirect your URL for greater flexibility.

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.