Open Source-PHP's MVC framework which one is the most cost-effective? Yii2 or thinkphp?

Source: Internet
Author: User
Tags codeigniter zend framework
一直接触和使用的是thinkphp和codeigniter,没有用过其他的PHP MVC框架。现在正在重构一个功能比较多的网站,但是工作时间太忙,回家时间很零散,所以需要快速完成上线。在公司用thinkphp ci,回家里也用thinkphp来做,感觉头都快炸了,真担心全都混淆了。所以想换一种。以前用过yii 1.x 体验不是很好,不支持命名空间,安装方法古怪。

To discuss which PHP MVC framework is more promising (not disband in a year or two).
The following features are met:

1)发行的稳定版本 支持命名空间,自动加载2)比较出名或者流行,有很大一个使用群体3)至少有一个正式的官网4)性能强大,扩展性强5)符合编程规范6)长远角度来看,团队不会突然解散(比较看重)7)不是小打小闹,应用很广泛。

This issue has been turned off because of an issue where the exact result cannot be obtained

Reply content:

一直接触和使用的是thinkphp和codeigniter,没有用过其他的PHP MVC框架。现在正在重构一个功能比较多的网站,但是工作时间太忙,回家时间很零散,所以需要快速完成上线。在公司用thinkphp ci,回家里也用thinkphp来做,感觉头都快炸了,真担心全都混淆了。所以想换一种。以前用过yii 1.x 体验不是很好,不支持命名空间,安装方法古怪。

To discuss which PHP MVC framework is more promising (not disband in a year or two).
The following features are met:

1)发行的稳定版本 支持命名空间,自动加载2)比较出名或者流行,有很大一个使用群体3)至少有一个正式的官网4)性能强大,扩展性强5)符合编程规范6)长远角度来看,团队不会突然解散(比较看重)7)不是小打小闹,应用很广泛。

Which PHP framework is better is an old question, and today finally has the answer.

The history of PHP frameworks

PHP is a magical technique that can be embedded in HTML code to execute. PHP relies on this unprecedented way of running, becoming a "language". PHP is a web-born, with the web growing, she is a highly abstract framework, all built-in functions, for example phpinfo() , is essentially a powerful function of an interface.

On top of PHP, which is itself a web framework, lazy programmers still want to do less work to do the same thing, so there is a common function group accumulated. Then, along with the progress of PHP, there are common classes, common libraries, and then have a common design pattern to achieve more code reuse, and finally, one after another PHP framework was born.

Immediately after the people found that PHP as the main development language in large-scale use of PHP code, the collaboration has become a big problem, so a variety of "lightweight framework" began to appear, the most famous is CodeIgniter. In fact, a little bit of a team and programmers with a little more than two years of experience will have their own PHP framework, which basically solves only one core problem: routing. Because this is the only thing that is common to all projects.

Laravel

At the same time, in the pursuit of development efficiency on the road, the various heavy-duty framework endless, Zend framework, CakePHP, Yii, Kohana, Symfony, Laravel, one than a blow louder, a more complex than a. Now, the occupancy and the highest mirror rate is Laravel: in foreign fire for some time, in the domestic tide is rising.

Laravel can greatly improve development efficiency.

Interested in Laravel can look at my series of Tutorials: Laravel 4 Series Introductory Tutorial "Best for Chinese Laravel", the current reading volume and response are also good, comments have accumulated a lot of common mistakes and solutions, I will be the first time to respond to everyone's comments.

Laravel has achieved so much today, not because of how high the author's level is, but how much PHP has experienced. In fact, Laravel's author, Taylor Otwell, was a. NET programmer who wrote three years of. NET after graduating from college and then turned to PHP, creating a great Laravel. Why? Because there is no limit on the train of thought. PHP from a bunch of functions that can be called directly from the development, in order to keep a lot of very powerful backward compatibility function, it is these functions, so that PHP skilled can't keep up with the development trend of PHP, can not face and use PHP5 excellent new ideas, new features. Now that PHP has evolved into a universal object-oriented language with many advanced features such as classes and objects, namespaces, interfaces, abstract classes, and so on, Taylor Otwell is using these advanced features to build today's Laravel.

The components currently being made by Brother Laruence are still being developed in a way that has PHP7 JIT PHP7-JIT HHVM multiplied performance advantages. That's why I didn't mention the C extension frameworks: JIT-out, C extension framework modification difficult disadvantage will greatly outweigh that little performance advantage, performance advantages may be completely disappeared. Let's wait and see!

Composer Eminence

"The time has come for Composer eminence!" "--Bai Yansong (:-D)

Composer can be seen as a PHP package manager, like Python's Easy_install and Pip,ruby's Gem,node.js NPM, is a powerful ecosystem. A detailed introduction and usage of Composer can be found in another article I wrote: Build Your own PHP framework (a) with Composer step-by-piece-basic preparation.

PHP for the web has been missing a Web-era package manager until Composer was born. Before the PHP framework is passed through the code file compression package, how bitter. PHP has an official "extension library" PEAR, but the storage standard is very strict, the code is very demanding, and the way to pass the code is to download the compressed package. :-(

Another very important reason for Laravel's success is to rely on the Composer community. Laravel employs a number of third-party packages, including many well-known Symfony infrastructure components.

Which frame is better?

Now, but from the perspective of development efficiency and community development, the first push Laravel , she also fully meet the requirements of the main question.

But powerful tools take a long time to learn, and Laravel may not be as easy to learn. Of course, the main reason is not how many advanced features are used in Laravel, but that most PHP programmers are reluctant to let go of the old php idea. The process of learning Laravel is to change the process of thinking, changing the process of writing PHP posture, this process will be more difficult, but also can learn a lot.

If you answer this question broadly, the most powerful frame of the moment is of course Composer, because she is not a framework and a powerful ecosystem.

About Yii2 and thinkphp in the problem

Yii2 just released a few days ago, claiming to be based on the Composer, I experienced a bit, with CodeIgniter 3rd is called based on the Composer is the same: to publish themselves to the Composer community. There is little reliance on other Composer packages, or the old way of going. Humpty, Halt. No matter how chatty is the whole community tens of thousands of small and beautiful.

Thinkphp as the most popular framework in China I used to be very supportive, but I was asked to use it once because of the project. When I see A() C() D() F() G() I() L() M() N() S() the function, I scare the urine, do you know what C() it is? Controller controllers? Caching cache? No, someone else is config, operating the configuration file. The code that is designed to be readable is basically zero.

Other frameworks

CodeIgniter 2 with eloquent ORM

If you're familiar with CodeIgniter, but you're tired of the tedious Active Record, I've made a CodeIgniter 2 with eloquent ORM project that Laravel the strongest part eloquent ORM Fused into the CodeIgniter 2.2.0 inside. See: Give CI Wings-use Laravel eloquent ORM in CodeIgniter 2

Tinylara

Finally, you can also try the Lite version of the Laravel that I built with Composer: Tinylara (official website: http://tinylara.com/), using the most powerful part Laravel ORM in eloquent, the other parts remain the most Streamline, welcome to try, put forward comments and suggestions!

Anyway, my opinion is: the more frame function, the more pits

Your needs are exactly the same as the framework. That's fine, when it's inconsistent, the more the frame functions, the more perfect the package, the worse the death. This is a typical "coincidence-based programming"

If the project needs are very normal to the general public, then simply on WordPress Drupal and so on, with the right plug-in and fine-tuning it
If the project has its own independent needs or needs long-term maintenance & iteration, the less frame function the better

Based on this, my own answer is
5.3 Ago (no namespace, no composer)
Write your own litphp
Open source to consider CI (function or too much, ancient times no composer also no way)

After 5.3 (Composer & PSR Standard)
Lit modern branch has not thought, temporarily have a aether, handy use
Open-Source Considerations Slim

Symfony definitely worth recommending, heavy frame, learning curve but there will be a lot of harvest, community improvement, enterprise-class framework performance is guaranteed, fig coding many frameworks are used to achieve the bottom!
If the time is more tense and small and medium-sized projects with TP bar, after all, look at the document side do can be achieved!
Yii has no use to know how!

Used Yii 1.x , recommended Yii 2.0 , but you really need to look at the 2 document carefully, maybe Yii is the best PHP framework.

Yii is known as the most powerful PHP framework, but if it is used to kill chickens, I still thinkphp, the document super careful, it is not easy to use because it is simple, because it is written in a very good document, very in line with the Chinese habit. Now many small and medium-sized enterprises have chosen thinkphp, do not believe you to open source China to see the PHP language Open source Project 10 of Eight is based on thinkphp, iron facts undoubtedly.

J8, don't hooves. "The focus is not on the framework---with the individual how to use" "the highest performance on the original ecological code." Like the thugs in the martial arts------No, no, you use whatever weapon is a "loser"

"Support TP" I used tp2.0 to do the dance of the music media 3 years ago "Whether it is safe or performance is very high" day access to more than 2 million ... Words do not speak more with strength

Currently in use is YAF and Yii2, simple and independent project with Yaf good, because it is very simple, integration is not high, too bloated project will forget, Yii2 feel PHP code more standardized, mainly like the code style

I used to compare a lot of frameworks with many channels. Transferred from CI to TP, in recent years has been fond of yii. 2.0 supports namespaces, as well as a complete set of APIs to simplify the implementation of RESTful Web service services. It's really cool to use, just turn around and use it before you know it.
1, make PHP or recommend Yii. The millet in the mouth, is the framework of Yii.
2, if do not engage in PHP, strongly recommend Ruby. 36KR is the best proof.

Choose the framework you are most familiar with. Which of Yii and thinkphp is ripe to choose.
Laravel and Symfony2 as learning goals. If the project is not urgent can use them to Daoteng.

PHP is a magical technique that can be embedded in HTML code to execute. PHP relies on this unprecedented way of running, becoming a "language".

This unprecedented is a little exaggerated, after the no-one is completely arrogant. A mature programmer after the time of baptism is not so arbitrary attitude toward things, even if it is the length of the collection of PHP (c functions, C + +, Java and C # classes and namespaces, ASP parsing and so on) only today.

I still recommend Yii2, but I kinda like laravel.

Y is out-of-the-box, crud one generates a bootstrap-based operator interface, and deep integration bootstrap with column filtering, sorting the GridView is not to be underestimated, Buy an admin HTML template directly on ThemeForest to write the background management interface will definitely let you hign fly up.

Well, I admit I didn't buy it myself, it's sitesucker bought it for me. By the way, the free adminlte is really good, and git on the Yii2 Adminlte also have, very convenient.

L's code logic is more stable than Y, from the Auth can be seen, but the basic route like a house, and no integration of front-end resources, plus the name of the coquettish will definitely make a person feel with a hammer cell phone B, by the way, L command is also artisan, compared to the hammer is less smart. Well, joking.

I would like to say: L is good, y or well, l look good, but Y is useful.

The guide to Y can absorb advanced ideas and learn a lot of things, really. Well, I can learn a lot from the doc at L. In China, I feel like Sony, the applause is not good.

I also used a period of time, found that Y2 design ideas are very catering to my tastes, such as oauth fast restful, fields renaming, and extraFields so on, see the author really very attentively, in Y1 inside these functions either find extension, or write their own.

There's a little thing.

PHP namespace with a slash also forget, that is no way, but can not be used to * quote a group of classes let me a bit uncomfortable, there is the object operator, have not played C + + hurt Ah, so far do not like -> , or Java . good. Now think about how good it would be if PHP was used + as a string connector.

Can you be a little more verbose?

It is said that L's thinking is very jumping, packaging is very thorough, so that I use the world's top PHP IDE-phpstorm also hint not thick. So I have to be prepared.

Said you may not believe, my recent test found that thinkphp faster than yii a little faster, much faster than laravel

Attached article address Laravel, YII, thinkphp performance test

Laravel good.

Cake
http://cakephp.org/

Yaf Framework Bar, written in c PHP extension, do not need to load any PHP files can be used by the framework, performance also dumped a lot of frames a few blocks!!

Yii2 good, but I think you need at least read the guide carefully.

Estimated that the landlord was yesterday to see my answer and then to ask this question, since then I suggest you use YII2 , no doubt, now my answer is the same YII2 .

YII2to build a website and how fast you can go to YII2 with GIT cloning, follow the basic model installation method or the Advanced model installation method to install a test, it won't take you a few minutes (the first installation is a bit slow, because of that composer ).

I have used, feel comfortable is the best.

In general, the recommended Symfony2, although the beginning of the steep, but absolutely satisfied with what you said "there is a prospect"

1) stable version of release supports namespaces, automatic loading
2) Relatively famous or popular, there is a large use of groups
3) At least one official website
4) Strong performance, strong scalability
5) Compliance with programming specifications
6) in the long run, the team will not suddenly dissolve (more valued)
7) It is not a very big, very wide application.
You are not pushing the rhythm of thinkphp ...

Laravel is now the hottest.

Laravel

TP Introduction, Laraval Depth

To pursue development efficiency, Laravel and Yii two selected one
Want to pursue performance, with Phalcon
Other basics are not to be considered, especially thinkphp.

I personally recommend Yii to do a bit better than thinkphp,yii in many ways.

Yii is also a good framework, starting from 2011, to a later version of a more complete, component-based development, powerful widgets, and there are many developers to maintain it, third-party components are also very good, there are many topics on the StackOverflow, developers can easily find the answer.

Frame this thing is to see which is suitable for which, do not what price, mainstream a few to understand. Master will see the scene decide which language to use, ordinary people learn several framework requirements do not count, do not embrace which frame to use. The role of the framework 1 is the rapid development of emergency, 2 is to learn the thoughts of others. 2nd is particularly important.

Really want to real deal dry up, oneself to ride. That's why it's said that you need to know a variety of frameworks and even multiple languages-so that you can take the longest.

Http://www.jitapu.me This guitar spectrum site is developed using YII2, you see performance, lightning fast! Open local file like!

  • Related Article

    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.