Yii Introduction
In this article, we’ll see Yii Introduction.
Table of Contents
What is Yii
Yii is a free and open-source, high-performance, component-based PHP framework. It is used for developing all kinds of web applications, including portals, forums, content management systems (CMS), e-commerce projects, RESTful Web services, and so on.
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 It Best for?
Yii Framework 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.
Compare with Other Frameworks
If you’re already familiar with another framework, you may appreciate knowing how It compares: Like most PHP frameworks, Yii implements the MVC (Model-View-Controller) design pattern and promotes code organization based on that pattern.
It takes the philosophy that code should be written in a simple yet elegant way and it will never try to over-design things mainly for the purpose of strictly following some design pattern. Also, 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.
It 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.
It 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.
Features
- 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.
- Its built-in code generation tool, Gii, speeds your app’s development scaffolding in MVC fashion
- Console Yii. You can run It 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 make building great-looking responsive apps much simpler
- Layered caching support It makes it easy to implement the kinds of caching that make sense to your application
- Security. It 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 It
- Extensions. Its community offers a variety of free, open-source plugins and widgets
- Internationalization. It supports I18N and makes it easy to provide localized versions of your app.
- Error handling, logging, and testing – yes, Yii delivers.
- It has a large and active community of users and developers, which means that there is a wealth of resources available for help and support.
Advantages And Disadvantages:
Advantages
- CRUD generator using Gii
- Nice ajax helpers especially with Grid view
- Nice layout and theming organization
Disadvantages
- AR doesn’t support many doctrines like AR queries
- Not very good at many to many relations (but there is a good plugin, namely the 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.
Hope this article helps!