FYB php framework-fybphp framework

Source: Internet
Author: User

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.

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.