Yii Introduction

What is Yii

Yii is a high performance, component-based PHP framework for rapidly
developing modern Web applications.

The name Yii (pronounced Yee or [ji :]) means “simple and evolutionary” in Chinese. It can also be thought of
as an acronym for Yes It Is!


What is Yii Best for?

Yii is a generic Web programming framework, meaning that it can be used
for developing all kinds of Web applications using PHP. Because of its
component-based architecture and sophisticated caching support, it is especially
suitable for developing large-scale applications such as portals, forums,
content management systems (CMS), e-commerce projects, RESTful
Web services, and so on.


How does Yii Compare with Other Frameworks?

If you’re already familiar with another framework, you may appreciate knowing
how Yii compares:
Like most PHP frameworks, Yii implements the MVC (Model-View-
Controller) design pattern and promotes code organization based on
that pattern.

Yii takes the philosophy that code should be written in a simple yet
elegant way.

Yii will never try to over-design things mainly for the
purpose of strictly following some design pattern.

Yii is a full-stack framework providing many proven and ready-touse
features: query builders and ActiveRecord for both relational and
NoSQL databases; RESTful API development support; multi-tier caching
support; and more.

Yii is extremely extensible. You can customize or replace nearly every
piece of the core’s code. You can also take advantage of Yii’s solid
extension architecture to use or develop redistributable extensions.
High performance is always a primary goal of Yii.

Yii is not a one-man show, it is backed up by a strong core developer team1,
as well as a large community of professionals constantly contributing to Yii’s
development. The Yii developer team keeps a close eye on the latest Web
development trends and on the best practices and features found in other
frameworks and projects. The most relevant best practices and features
found elsewhere are regularly incorporated into the core framework and exposed
via simple and elegant interfaces.


  • Model-View-Controller architecture. Just like Ruby on Rails, now you can leverage MVC in your PHP apps.
  • Database Access Objects (DAO), Active Record, and programmatic Database migrations simplify the challenges of building database-powered web applications.
  • Form input, validation, and Ajax support is built-in. Yii makes forms pretty easy.
  • Built-in authentication and powerful user management extensions make launching new web applications easy.
  • Yii’s built-in code generation tool, Gii, speeds your app’s development scaffolding in MVC fashion
  • Console Yii. You can run Yii from the command line or as a daemon. With this, it’s possible to build high performance background tasks in PHP.
  • Theming options such as the Bootstrap extension makes building great looking responsive apps much simpler
  • Layered caching support Yii makes it easy to implement the kinds of caching that make sense to your application
  • Security. Yii greatly minimizes the typical risk factors of running services with PHP and MySQL
  • Integration with other frameworks. It’s easy to use Zend or PEAR features in Yii
  • Extensions. Yii’s community offers a variety of free, open source plugins and widgets
  • Internationalization. Yii supports I18N and makes it easy to provide localized versions of your app.
  • Error handling, logging and testing – yes, Yii delivers.

Advantages And Disadvantages Of Yii Framework:

PROS

  • CRUD generator using Gii
  • Nice ajax helpers especially with Grid view
  • Nice layout and theming organisation


CONS

  • AR doesnt support many doctrine like AR queries
  • Not very good at many to many relations (but there is a good plugin, namely CAdvancedArBehavior extension to do this)
  • The ajax functions for various things, like the grid aint that well documented so often you need to explore the javascript code.

One thought on “Yii Introduction

Leave a comment