What is MVC ?

MVC is an acronym for Model View Controller.
It is a software architectural pattern which aims at separating business logic from the presentation part.

A typical MVC Architecture is shown below :
Model View Controller

As we can see there are 3 major components :

1. Model : The model manages data and the business logic of the application, It is responsible for data manipulation and functionality of the system.Model receive request from controller then it perform certain task and send the result back to the controller.

2. View : It is responsible for presentation of data or model i.e the visual format of data, It just receives data from the controller and displays it to the user through browser in this case.

3. Controller : It is the most important component of MVC. Controller manages the communication between the model and view. It acts as the mediator between them. It takes user inputs, interact with model and updates the view.

In Yii framework every user request is passed to the controller which then decides where to go for further processing.

How to configure eclipse to support yii framework ?

In this post we will see how to enable Yii framework support in Eclipse for faster coding and web application development.

If you don’t have Eclipse you can download it from here, Download the standard version it will be a zip file, unzip it and run eclipse.

The installed Eclipse doesn’t have support for PHP language, So first we need to configure it for PHP development, for that we need to install PHP Development Tools.

In Eclipse
> Go to Help
> Click on Install New Software…
> In Work with: select –All Available Sites–

The available plugins will be loaded, search for php in it

> Select all the 3 tools
> Click on Next and install it

Install PDT

Now your Eclipse is configured for PHP Development.

For Yii framework support we need Yiiclipse.

Yiiclipse is the plugin that provides Yii framework integration in Eclipse, It provides New Yii Application wizard, code completion and code navigation tool.

Again we have to install it through, Install New Software Wizard

> Go to Install New Software…

Copy this url and paste it in Work with: and press enter
http://yiiclipse.maziarz.org/updatesite/STABLE/

Install Yiclipse

> Click on Next and install it.

Restart the eclipse for the changes to take effect.

Now you can create new Yii project in Eclipse

First change the perspective to PHP
>Go to Window > Open Perspective > Other > Select PHP

For Creating Yii Project
> Go to File > New > Other

New Project

In type filter text type yii
> Select New Yii Framework Project

New Yii Wizard

> Enter Project Name:

Project Name

After this you will see 2 option
1. use local – if you already have Yii framework then select this and provide path where it is located.
2. download – if you don’t have it then select this and select the sample project you want.

Yii Create Option

Click on Finish, In Project explorer you can now see the framework is in the project include path.

That’s all.

What is Yii ?

Yii is an acronym for Yes, it is, and is pronounced as Yee or (ji:).
It is a PHP framework for rapidly developing any web application, Like most other PHP frameworks it also follows the MVC pattern.The best thing about Yii is that it is highly optimized framework due to which it is best suited for heavy web application where performance is a major issue.

You can use Yii for your web application because of following reason :

  • It is highly optimized (High Performance)
  • It is fast
  • It is easy
  • It is extensible (Core framework classes can be extended easily)
  • It is very secure