- Gii – Generating Module
- Gii – Generating Controller
- Gii – Creating a Model
- Yii - Gii
- Yii - Localization
- Yii - Authorization
- Yii - Authentication
- Yii - Error Handling
- Yii - Logging
- Yii - Aliases
- Yii - Fragment Caching
- Yii - Caching
- Yii - Testing
- Yii - Fields
- Yii - RESTful APIs in Action
- Yii - RESTful APIs
- Yii - Theming
- Yii - Database Migration
- Yii - Active Record
- Yii - Query Builder
- Yii - Data Access Objects
- Yii - Database Access
- Yii - Dependency Injection
- Yii - Configurations
- Yii - Creating a Behavior
- Yii - Behaviors
- Yii - Creating Event
- Yii - Events
- Yii - GridView Widget
- Yii - ListView Widget
- Yii - Data Widgets
- Yii - Data Providers
- Yii - Properties
- Yii - Sorting
- Yii - Pagination
- Yii - Formatting
- Yii - Files Upload
- Yii - Using Cookies
- Yii - Cookies
- Yii - Using Flash Data
- Yii - Sessions
- Yii - AJAX Validation
- Yii - Ad Hoc Validation
- Yii - Validation
- Yii - HTML Forms
- Yii - Rules of URL
- Yii - URL Routing
- Yii - URL Formats
- Yii - Responses
- Yii - HTTP Requests
- Yii - Creating Extensions
- Yii - Extensions
- Yii - Asset Conversion
- Yii - Assets
- Yii - Layouts
- Yii - Views
- Yii - Modules
- Yii - Widgets
- Yii - Models
- Yii - Using Actions
- Yii - Using Controllers
- Yii - Controllers
- Yii - Entry Scripts
- Yii - Application Structure
- Yii - Create Page
- Yii - Installation
- Yii - Overview
- Yii - Home
Yii Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Yii - Overview
The Yii[ji:] framework is an open-source PHP framework for rapidly-developing, modern Web apppcations. It is built around the Model-View-Controller composite pattern.
Yii provides secure and professional features to create robust projects rapidly. The Yii framework has a component-based architecture and a full sopd caching support. Therefore, it is suitable for building all kinds of Web apppcations: forums, portals, content managements systems, RESTful services, e-commerce websites, and so forth. It also has a code generation tool called Gii that includes the full CRUD(Create-Read-Update-Delete) interface maker.
Core Features
The core features of Yii are as follows −
Yii implements the MVC architectural pattern.
It provides features for both relational and NoSQL databases.
Yii never over-designs things for the sole purpose of following some design pattern.
It is extremely extensible.
Yii provides multi-tier caching support.
Yii provides RESTful API development support.
It has high performance.
Overall, if all you need is a neat interface for the underlying database, then Yii is the right choice. Currently, Yii has two versions: 1.1 and 2.0.
Version 1.1 is now in maintenance mode and Version 2 adopts the latest technologies, including Composer utipty for package distribution, PSR levels 1, 2, and 4, and many PHP 5.4+ features. It is version 2 that will receive the main development effort over the next few years.
Yii is a pure OOP (Object-Oriented Programming) framework. Hence, it requires a basic knowledge of OOP. The Yii framework also uses the latest features of PHP, pke traits and namespaces. It would be easier for you to pick up Yii 2.0 if you understand these concepts.
Environment
The major requirements for Yii2 are PHP 5.4+ and a web server. Yii is a powerful console tool, which manages database migrations, asset compilation, and other stuff. It is recommended to have a command pne access to the machine where you develop your apppcation.
For development purpose, we will use −
Linux Mint 17.1
PHP 5.5.9
PHP built-in web server
Pre-installation check
To check whether your local machine is good to go with the latest Yii2 version, do the following −
Step 1 − Install the latest php version.
sudo apt-get install php5
Step 2 − Install the latest mysql version.
sudo apt-get install mysql-server
Step 3 − Download the Yii2 basic apppcation template.
composer create-project --prefer-dist --stabipty=dev yiisoft/yii2-app-basic basic
Step 4 − To start a PHP built-in server, inside the basic folder run.
php -S localhost:8080
There is a useful script, requirements.php. It checks whether your server meets the requirements to run the apppcation. You can find this script in the root folder of your apppcation.
If you type http://localhost:8080/requirements.php in the address bar of the web browser, the page looks pke as shown in the following screenshot −
Advertisements