Wiki

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

PHPStorm & NetBeans autocomplete problem

Created about a year ago by StagelineTips1 comment – viewed 7,568 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 3 years ago by zaccariaTips0 comments – viewed 6,468 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 about a year ago by Rodrigo CoelhoTips2 comments – viewed 45,514 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 2 years ago by StammTips7 comments – viewed 14,372 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.

htmlOptions explained for various controls.

Created 3 years ago by WoilTips1 comment – viewed 41,197 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:

Special $variables in CGridView and CListView

Created 2 years ago by Steve FriedlTips10 comments – viewed 42,128 times – ( +25 / -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.

Understanding series articles

Created 2 years ago by GOshaTips0 comments – viewed 7,798 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 fsbTips4 comments – viewed 24,945 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 2 years ago by JobloTips7 comments – viewed 34,049 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 35,189 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):