Question2answer Forum Framework Analysis and Web development thinking

Source: Internet
Author: User

July 25, 2015 17:31:42 Saturday

A dedicated forum open source PHP framework, there are backstage, support multi-lingual

The portal file is the index.php of the framework root directory

He contains/qa-include/qa-index.php: re-assemble the parameters in the URL into the $requestparts array.

The qa-index.php file contains the/qa-include/qa-page.php file at the end of the document:

1. At the end of the file, call the Qa_get_request_content () function, based on the array obtained in the previous step, including the corresponding PHP file

2. A route is used when it is included and is defined in this file.

3. After this function is processed, an array is generated, and at the end of the file, the Qa_output_content () function is called to convert the array into an HTML document output

Conclusion:

Like Syfony, it's a pit-to-hole framework, where there's no dedicated full HTML page: Meta, JS, CSS references are referenced in the framework, form forms, and so on, are generated by PHP functions,

TMD, it's not dead. PHP and front-end development?

Summary: MLGB CAO

======================

Spit Groove

Technically, no matter what the language of the framework, MVC or non-MVC, in the final analysis is the file of mutual inclusion, or include, require, or import

From the big environment, not the MVC popularity, is because the program development is more and more specialized, the front end concentrates on the front-end development and uses the popular technology, the back end concentrates on the backend development and uses the popular technology

and MVC just adapts to the situation, the back end and the front end of the battlefield separate, who do not depend on who, can make both sides fully control their own territory

-----------------

Now the program development environment is in the transition phase,

Example 1. PHP in the smarty, is the product of the excessive stage, he created a set of syntax, can be similar to HTML tags to write back-end code, the goal is to the front-end development, (the United States its name and front end separation)

But it's actually all phper in use. Front-end developers, do not give them the task, who he use Ah, phper both familiar with PHP syntax, but also familiar with the Smarty grammar,

Why bother, PHP itself is the template language, itself can be nested in HTML, why use you smarty, Sibuxiang

Example 2. Angular.js, his appearance, (possibly) will completely release the backend development, the front-end development also has more power, the server pressure has also become smaller

Because, Angular.js accepts JSON results, DOM rendering is entirely controlled by JS.

before:

On the server side, Php/java the data from MySQL, including the HTML page, stuffing the data into the HTML file where it should be, and then returning it to Apache/nginx

And then back to the browser rendering

Now Angular.js:

Server-side, Php/java the data from the database read out, assembled into a JSON string, together with the HTML page is sent to the browser,

And the HTML is only issued once, subsequent user interaction when the page (data) changes, only the use of the JSON data issued

Back-end developers do not need (or rarely) to manipulate the HTML file (empty, for loop, etc.), the operation is completely scattered to the browser side to let JS go to execute,

The pressure on the server is naturally small, just like app development, and the next operation is to invoke the service-side interface completely.

Seo:

With the angular.js, nature will take into account the problem of SEO, now Baidu Google are in support of this technology, there is no need to worry about SEO

Because the search engine is also competing with each other, but also want to include more than the opponent more useful pages, so do not worry about search engine is included in the problem

Plainly, the main is to do your site, poke the user's pain point, or your SEO will be suspected of cheating,

Search engine daily Crawl/ingest a large number of pages, he is also tired, and the page content is not bad, once found cheating he will never come

Question2answer Forum Framework Analysis and Web development thinking

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.