When comparing Yii vs Hapi, the Slant community recommends Yii for most people. In the question“What are the best backend web frameworks?”Yii is ranked 16th while Hapi is ranked 28th. The most important reason people chose Yii is:

Since security is a crucial part of any application, Yii comes with great security features out of the box to help developers create a secure and reliable application. These security features contain but are not restricted to:
* Input validation
* Output filtering
* Features against SQL injection
* Cross-site scripting prevention

Pros

Pro

Comes with important security standarts

Since security is a crucial part of any application, Yii comes with great security features out of the box to help developers create a secure and reliable application. These security features contain but are not restricted to:

Pro

Integrated with a testing framework

Yii makes use of Codeception, a great PHP testing framework that helps developers run their tests. They can be unit, functional or acceptance tests since Codeception supports them all.

Pro

Lots of plugins available

Yii has about 2000 addons hosted on Yii's official website. These addons significantly decrease development time and increase the developer's efficiency.

Pro

License

Yii is free and open source and is distributed under the BSD License.

Pro

Strong community support

Yii has a strong and rather large community behind it. This is proven by the great number of blog posts, tutorials, guides and reviews on the Yii framework as well as the great number of extensions developed for it.

Pro

Easy to install

Yii uses Composer to handle it's dependency installation. This is rather easy and not very time consuming, although it should be noted that Composer is very resource-intensive considering what it's job is. But that is not really Yii's fault.

Pro

Best framework for CRUD operation

Yii Framework Provides most of features require for crud functionalities like GridView, Listview and DetailView (with jquery search and validation functions) by generating using GII.

Pro

Highly extensible without effort

Pro

Consistency across applications

Hapi's philosophy is that configuration is more important than code. This is especially useful for very large teams because it helps developers maintain consistency and reusability throughout their code.

Pro

Backed by a major corporation

Hapi was developed and is still being used by Walmart. Being backed by such a major company means that it will not lose support any time soon and most importantly it's being developed by professionals and that you will always get support for it.

Cons

Con

Can be hard for beginners

Since Yii requires developers to write code following certain rules, or in other words, it requires developers to follow the "Yii way of doing things" it can be hard for beginners to warm up to it and start using it right away.

Con

Not very good at many to many relations

(but there is a good plugin, namely CAdvancedArBehavior extension to do this)

Con

Requires too much boilerplate

Hapi seems to be made with large applications in mind. The sheer amount of boilerplate code it requires is simply not practical for a small web app. This also means that there are few examples of Hapi applications around for beginners to learn from.

Ad

Alternative Products

Each month, over 1.7 million people use Slant to find the best products and share their knowledge. Pick the tags you’re passionate about to get a personalized feed and begin contributing your knowledge.