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... SyntaxHighlighter. all ();
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
[Plain]View plaincopy
-
- 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.
Author: tomyjohn