The structure in YII2 feels messy. Can't I keep up with the situation?

Source: Internet
Author: User
YII2 uses composer to create a project. And there are a lot of extra things. It seems that the writing is not formal. In addition, the performance will decrease if you use vendor to manage the import? YII2 uses composer to create a project. And there are a lot of extra things. It seems that the writing is not formal.
In addition, the performance will decrease if you use vendor to manage the import?

Reply content:

YII2 uses composer to create a project. And there are a lot of extra things. It seems that the writing is not formal.
In addition, the performance will decrease if you use vendor to manage the import?

I don't know much about Yii/Yii2. Why should you use Composer? I think the following is a simple sentence:

For developers, it is great to use composer.

Composer is a dependency management tool for PHP Development (@ bigqiang Xie ). There are various packages at https://packagist.org/which can help you solve various dependencies. During development, the wheel of authority is always more time-and labor-saving than self-effort, and has withstood the tests of the masses. For example, Laravel uses many independent Symfony component libraries. With tools like Composer, you don't have to download a library, organize directories, maintain the version of the library, and consider how to integrate the library into your project.

The automatic loading mechanism of Composer does not reduce the performance (or, even if there is one, it will be minimal ). Because each package will define its own loading mechanism, such as classmap, psr-0, psr-4, Composer just performs automatic class loading based on this mechanism, rather than loading them all or part, or there is a lengthy loading list (but sometimes the array storing the loading list is not small, but this has little impact on performance ).

PS: if we work in a version control tool, we usually exclude/vendor. The benefit of doing so is that only your own code is included in the project file, it won't be much bigger (I wrote something a while ago, but it only brought the library introduced by composer to 100 MB + ). Then, we only need to composer install in another environment to get the specified, updated, and more stable dependent libraries.

Yes.

Good habits. I think Yii2.0 is good.

I also have a deep feeling that yii2 gives me the feeling that we are using a very backward method for a thorough refactoring.
For example, why does bootstrap need to be performed in the template first?$this->registerCssFile() $this->registerJsFile()But the problem is that my bootstrap template is like this.

html    
  

How does he$this->registerJsFile()In?
Another method is used to reconstruct a sound function and powerful program. Without innovation, it takes a lot of energy and effort to develop such a framework. It is incredible that one person has done it.

Supplement:
Comparing ci, thinkphp, and yii2, I think yii2 is still very good. xueqiang is developing such a framework by itself, and it is far-fetched to move the java model hard, it will make PHP programmers feel awkward.

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.