Wiki

Articles in category "tips", sorted by ratingX
Displaying 11-20 of 135 result(s).

PHPStorm & NetBeans autocomplete problem

Created about a year ago by StagelineTips1 comment – viewed 8,068 times – ( +22 ) – version 1.1
The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.

Reading the doc

Created 4 years ago by zaccariaTips0 comments – viewed 6,583 times – ( +21 ) – version 1.1
Almost all the information you need whilst working with yii is written in the Class Reference.
tags: doc

The complete beginner's study guide for the Yii Framework

Created 2 years ago by Rodrigo CoelhoTips2 comments – viewed 48,008 times – ( +20 ) – version 1.1
Start studying the MVC pattern. You will understand the roles of the model, the view and the controller and know where goes each part of the code.

Using cache in CActiveDataProvider

Created 3 years ago by StammTips7 comments – viewed 14,937 times – ( +20 ) – version 1.1
First param in CActiveDataProvider could be a string with model name or instance of class. So, you may use CActiveRecord::cache() for cache, but you need set third param to 2, because you should cache 2 queries: counting and get data.

Special $variables in CGridView and CListView

Created 3 years ago by Steve FriedlTips11 comments – viewed 44,004 times – ( +26 / -1 ) – version 1.1
The popular CListView and CGridView widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.

htmlOptions explained for various controls.

Created 3 years ago by WoilTips1 comment – viewed 42,552 times – ( +17 ) – version 1.1
Most controls that are rendered by CHtml have an argument called $htmlOptions. This argument is an array that holds the attributes of the HTML element. For example the following code:

Understanding series articles

Created 2 years ago by GOshaTips0 comments – viewed 7,910 times – ( +16 ) – version 1.1
Here are all wiki articles from "Understanding" series by Yii wiki contributors:

1:n relations sometimes require CDbCriteria.together

Created 2 years ago by fsbTips5 comments – viewed 26,156 times – ( +16 ) – version 1.1
There are situations in which Active Record will generate nonsense queries from what a nieve Yii user might think is reasonable code. One such situation is a CActiveDataProvider using CDbCriteria to get data from parent and 1:n child table with a condition on the child table.

CGridView: Display the full record (actionView) in a CJuiDialog

Created 3 years ago by JobloTips7 comments – viewed 35,158 times – ( +15 ) – version 1.1
If you show a model (with a lot of attributes) partially in a CGridView, it can be helpful when the user can take a quick look at the full record with all attributes without displaying the view as a page and afterwards returning back to the gridview.

Styling Radio Buttons

Created 3 years ago by Steve FriedlTips4 comments – viewed 36,799 times – ( +15 ) – version 1.1
The default behavior with radio button lists is ugly, and I figured out mostly how to style them a coupla different ways. I'll used the blog tutorial example (but with my own posting modes):