Yii PHP Framework 1.1.x Yii PHP Framework: Best for Web 2.0 Development yii is a high-performance component-based php framework best for web 2.0 development.

How to get response as json format(application/json) in yii?

How to get response as json format(application/json) in yii?

Source: (StackOverflow)

Where to learn Yii? [closed]

I have been trying to learn Yii without luck. I find Zend Framework, Kohana, Code Igniter among other frameworks much easier to learn than Yii. The documentation also su**s. Can you post links to easy-to-understand and well written tutorials/articles? The official documentation is filled with grammar errors and seems to be rushed...

Source: (StackOverflow)


Yii model to array?

How can I convert the result of Trips::model()->findAll() to an array?

Source: (StackOverflow)

When to use components and when to use extensions in Yii?

I'm a little bit confused about the purpose of components and extensions folders in protected/

Please clarify.

Source: (StackOverflow)

yii2 data provider default sorting

In yii this code works for default sorting:

$dataProvider = new CActiveDataProvider('article',array(
            'defaultOrder'=>'id DESC',

How default sorting can be set in yii2?

tried below code, but no result:

$dataProvider = new ActiveDataProvider([
        'query' => $query,
        'sort' => ['defaultOrder'=>'topic_order asc']

Source: (StackOverflow)

Include CSS,javascript file in Yii Framework

How to include a Javascript or CSS file in Yii Framework?

I want to create a page on my site that has a little Javascript application running, so I want to include .js and .css files in a specific view.

Source: (StackOverflow)

Get current URL/URI without some of $_GET variables

How, in Yii, to get the current page's URL. For example:


but excluding the $GET_['lg'] (without parsing the string manually)?

I mean, I'm looking for something similar to the Yii::app()->requestUrl / Chtml::link() methods, for returning URLs minus some of the $_GET variables.

Edit: Current solution:

unset $_GET['lg'];

echo Yii::app()->createUrl(
  Yii::app()->controller->getId().'/'.Yii::app()->controller->getAction()->getId() , 

Source: (StackOverflow)

Quickest ways to speed up your YII application?

I've just started using YII and managed to finish my first app. unfortunately, launch day is close and I want this app to be super fast. So far, the only way of speeding it up I've come across, is standard caching. What other ways are there to speed up my app?

Source: (StackOverflow)

addColumn yii migration position

I want to add a column at the seventh place in the table, I am using


adds the column at the end. Is there any way where I can mention the place to add column? Or any after column keyword to add my new column after, for exapmle, password column. I have learnt aboout migration from Yii Doc

Source: (StackOverflow)

multi model forms in yii

How to create a multi-model form in Yii? I searched the entire documentation of Yii, but got no interesting results. Can some one give me some direction or thoughts about that? Any help will be appreciable.

Source: (StackOverflow)

Yii framework: Controller/Action url & parameters

In my application , I have ApiController with actionUsers, So in YII the path becomes api/users. Now in order to get certain users info , I use the following path api/users/id/10 where 10 is the userID and id part of the path is basically a GET parameter (api/users?id=10).

Is there any way to do the same thing without id part of the path, i.e. I want my path to look like api/users/10?

Thank you!

Source: (StackOverflow)

What is the difference between homeUrl and baseUrl in Yii frame work?

What is the difference between homeUrl and baseUrl in Yii frame work ?

Source: (StackOverflow)

Yii: Render action using different layout than controller's layout

In Yii, is there a way to render a single action using a different layout than that defined for the controller? I have an action that I would like to format differently from the rest, and it's not clear from the documentation if that's possible.

Source: (StackOverflow)

Cakephp and Yii: similarities/differences/speed?

I am a CakePhp programmer. I have decided to try out the Yii framework. I would like to find out in what ways is CakePhp is similar to and different from Yii. Also, is Yii measurably faster than CakePhp as they claim?

Source: (StackOverflow)

yii: how to make a unique rule for two attributes

I have a table like this: (id, name, version, text). (name, version) is unique key, how can i make a rule to validate this.

Source: (StackOverflow)