Home  >  Article  >  php教程  >  Which PHP framework is better?

Which PHP framework is better?

巴扎黑
巴扎黑Original
2016-11-07 16:50:581462browse

There is a lot of time during the National Day. In addition to watching people running around at home, I also studied several frameworks, namely thinkphp, yii, and CodeIgniter frameworks.

Just tell me briefly.

In terms of learning curve

yii>thinkphp>CI, personal experience.

In getting started with yii, I mainly spent time on installation, configuration and deployment. The entry file of Yii is not in the root directory of the project, so apache needs to be configured. Of course, this is safer.

In fact, thinkphp can also place projects in non-site directories. This is mentioned in the manual.

In terms of "light heavyweight", I feel that CI is lighter

CI

In terms of the manual (English does not count)

thinkphp>CI>yii

On the use of cache

thinkphp>yii>ci

Automatic code generation

Only Yii has an automated code generation tool

thinkphp thinks more about developers in terms of use, while Ci does less but The scalability is better, and yii....

One thing I am not very satisfied with yii is the directory structure, like the tp framework and the CodeIgniter framework. The default root directory is two folders and an entry file

such as

thinkphp’s directory is like this:

---Application (Application)

---ThinkPHP_3_2_3 (Framework)

---index.php (entry file)

CodeIgniter is like this

- --application (application)

---system (framework)

---index.php (entry file)

The directory of the yii framework is like this

---backend (backend application)

---common(common configuration classes, etc.)

---console(console)

---environments(Yii’s own environment check file)

---frontend(frontend application)

- --vagrant

---vendor

This is very fatal for me because the code looks untidy if there is one missing space and I have to add one more space. Of course, through configuration, Yii can still put the application in a directory. But after all, we are using a framework, and we still hope to reduce configuration or operations.

Of course Yii is better in underlying design

Although Yii has many shortcomings, I still prefer Yii (Yii with only two directories).

In the application, I added an additional logic layer to Yii. This way, the code looks better for large projects.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn