What are the advantages of the YII framework?

Source: Internet
Author: User
0 reply: What are the advantages of the YII framework? -Answer from Zhou Jian
Yes, this answer is for you. After countless at errors, I decided to cancel at orz ..

When I saw this answer and a series of questions, I couldn't wait to raise my pants to answer your series of questions.
First of all, you have used several absolute terms. I can only say that I admire your self-confidence, "TP development efficiency is definitely higher than Yii", "TP must be more suitable for Chinese thinking", "TP additional value is definitely higher than Yii", your series of absolute, for me, this is not true. Even if 99 out of 100 people agree with your opinion, the word "absolute" is not true!
Existence is justifiedSo I did not comment on the quality of the TP framework, but I once saw a friend's comment on TP. Although explicit, I think it is reasonable-"TP is not designed, it can only be said that it is a collection of tools. "Even so, I do not deny TP. After all, the share in China is there. It is like a lot of people are still saying PHP, Existence is reasonable.
Okay. I will answer your questions one by one.
-------------- Split line -----------
1. First, this question is raised, indicating that your understanding of the MVC model is biased. MVC only proposes the separation of data-View-business logic, but there is no PHP code in the view, as long as the PHP In the view is doing "performance", it will not deviate from MVC.
Second, even if PHP code is not displayed in the view, Yii can introduce templates such as Smarty, but I also think it is unnecessary. In many scenarios, the introduction of Smarty requires backend and front-end developers to re-learn a set of languages. If PHP is used as a template directly, front-end developers only need to simply learn the syntax to set pages, even if we leave aside the efficiency, if the front-end staff would neither be php nor smarty, then they simply learn some php syntax, and the cost is not necessarily higher than learning smarty. Therefore, at present, in our company (each with 20 + personnel), Yii is used directly and php is used as a template;
2. widget, apparently, is not omnipotent, but can you give another example to illustrate what is omnipotent? (Money? Laugh ~), An applicable scenario: the search box that appears on many pages of the site. It is very convenient to use widgets.
As for the issue of passing JavaScript code, I haven't known how to use Yii ClientScript after five months. It also shows that I am not using it too deeply;
3. The original design of gii is not to generate business logic for you. gii is to generate a list, form, and delete actions for regular CRUD operations on tables during Web development, the background of all projects I have done is generated based on gii, AND THE DEVELOPMENT efficiency is greatly improved;
As for the style, since you don't need it, don't you know that you can customize a set of Gii templates?
4. There is no need to answer this question if the author is abroad or in China. This has nothing to do with Yii.


To sum up, the answer is only for answering the primary question. If you don't want to blow it off, I can say about 800 words if you want to vomit yii, the answer to the primary question is indeed not the point where yii should be hacked, however, when I saw the speaker's voice, the speaker said a number of "absolutely" could not help but raise objections. I joined my blog, "yiiframework, a simpler way to construct a local page." C is created under the Yii Framework. # Html. renderAction

The Team has been using Yii for nearly two years.
We migrated from NET to use php for re-development. At that time, we considered a considerable number of frameworks and finally decided to use Yii.

1. The Code style of the Yii framework is similar to that of net, so that the original staff of our team can easily read the php code and get started quickly.
2. The Yii framework has a high support for expansion, which is very convenient. We have extended many components by ourselves. Recently, we even modified the program entry, allowing us to manipulate the program in the framework.
3. Important performance: Yii has excellent performance and is a lightweight framework. Spl_autoload_register pre-registration, file loading on demand, and so on have greatly improved performance.
4. The modules design is very good. Theoretically, it can be nested infinitely. Of course, it is not recommended to nest more than three layers. Although we nested two layers.
4. The application of widget widgets makes it easier to construct common modules. Of course, we also have more convenient methods to construct common modules.
5. In fact, the integrated model and the verification mechanism contained in the CActiveRecord mode are good, but the constraints are also relatively strong.
6. The Yii framework encapsulates various caching methods, allowing you to switch between different caches by calling a uniform method.

Load the view of the specified action to the current page in inline mode · Issue #2579 · yiisoft/yii · GitHub I wrote a more convenient method to construct a common interface. Not perfect. It is still being improved. I hate his activeform and jquery binding so deeply. Use it. I am tired of jquery. Don't use it. People who take over will scold me! Also, zend is becoming more and more popular.

Others like php, which is simple and complicated. If you do not study it in depth, it is difficult for me to use ci, tp, zf, and yii, I feel that tp is a pseudo-oop framework, and there is no design pattern at all. In particular, embedding templates such as smart into the framework is a big failure. The only advantage is that it is easy to learn, I personally think that yii is more than two levels higher than tp. Yii has three groups,
Two are full, 121116851 Yii China 67572979 Yii
It's almost full. 127319423 Yiibook discussion group
There will be a lot of people reporting it right away...
Sending code every day

Yii is the best practice for PHP rapid development. Reference: http://www.yiiframework.com/doc/guide/1.1/zh_cn/changes And http://www.yiiframework.com/features/
You need to use it.

6.20 supplement:
Currently, well-known companies in China are listed as Shanda, dual play, rice, and red umbrella. Reference: http://www.isyii.com/sites
YII-based open source projects include: http://www.isyii.com/open
Yii Extension Based on sina open platform I wrote: http://yii4sae.sinaapp.com Yii4sae is the best practice for deploying the Yii framework to the Sina Open Platform (SAE. Yii can be deployed to SAES without modifying the Yii source framework code. The scalability of Yii is evident.


2016.6.3 supplement:
Yii has now grown to 2.0, and Yii has been used by dozens of times or more companies. Yii has the biggest advantage of being fast, agile, and not procrastinating. It gives programmers the ability to fly. Of course, please do not compare. Different people are suitable for/like different things. If you have never used Yii, you can try it. At least I have been using it for almost two years. It feels good. YII is really good. I am against it if it is too dependent on the framework to really understand programming.
At least YII's understanding and Improvement on programming are helpful. If you haven't studied YII, you can't say YII here. I suggest you check YII! When I used to learn PHP, files were randomly stored, and the concepts of controllers and models were not very clear.
After using yii for a while, you can get into good habits.

The components are very powerful and many things have been written. It can be used directly. Let's talk about the disadvantages.

Yii migrate is a little pitfall, but it is estimated that no one actually uses it.
The document is concise.

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.