FYB php framework-fybphp framework
Objective: The Learning PHP framework and framework have few codes, are easy to understand, facilitate expansion, and are fully object-oriented,
PHP framework
New users still need to develop basic knowledge, especially for Array Operations and the MVC mode, which may be used in the future. Second, learning the database well is conducive to the learning of the framework,
The framework is actually extended development according to some syntaxes defined by this framework, and its architecture may increase the reuse of code. At present, ZF, YII, and THINKPHP are popular in China. But in the end, the frameworks are all in the MVC mode and can be written by myself in the future.
How to Use the php development framework?
I usually do not speak either. Write a code today to show you: Simple Model Layer
Product. class. php:
<? Php
Class product {
Public function getAllProducts (){
$ Q = "SELECT * FROM Product ";
$ R = $ db-> query ($ q );
$ ProArr = array ();
While ($ row = db-> fetchAssoc ($ r )){
$ ProArr [] = $ row;
}
Return $ proArr;
}
}
?>
View and control layer:
Getallproducts. php:
<? Php
$ Product = new product ();
$ Ps = $ product-> getAllProducts ();
Foreach ($ ps as $ p ){
// Output
Echo $ p ['name'];
}
I usually write more PHP statements like this, that is, most of them program arrays,
Most of them are SQL statements output on the page, nested HTML, the page looks bloated, not easy to maintain and expand
In this way, it is easier to modify the layer.