PHP Framework Development 1 (preface)

Source: Internet
Author: User
PHP framework development I (first) most PHP frameworks are now designed with a unified entrance, similar to TP. First, repetitive wheel creation is not a bad thing. Instead, it can give us a certain understanding of a technology or architecture. I am not opposed to rebuilding the wheel. However, in the development process, after all, these mature frameworks are much faster to develop, and bug php framework development I (first speech)

Currently, most PHP frameworks are designed with a unified entrance, similar to TP. First, repetitive wheel creation is not a bad thing. Instead, it can give us a certain understanding of a technology or architecture. I am not opposed to rebuilding the wheel. However, in the development process, after all, these mature frameworks need to be much faster, and the BUG quantity and security are much better than our frameworks.

However, this is not the reason we will not do it. In the following chapters, let me lead you to build a small Framework. This may not be used for your development, but it will certainly help you understand the unified entrance.

Step 1: Create a directory with the following structure:

Step 2: Create an htaccess file if you do not need the URL pseudo-static mode. Negligible

 
  
RewriteEngine on RewriteCond % {REQUEST_FILENAME }! -D RewriteCond % {REQUEST_FILENAME }! -F RewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L]

 

Step 3: You can see from the preceding directory structure that my unified entry is index. php. from this file, call the simple. php file in the simple folder. Including the configuration file, the MVC three-layer structure is in the simple folder.

In the next chapter, I will introduce the use of the SPL library and controller.

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.