Wiki

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

PHPStorm & NetBeans autocomplete problem

Created 2 years ago by StagelineTips2 comments – viewed 9,185 times – ( +24 ) – 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,853 times – ( +21 ) – version 1.1
Almost all the information you need whilst working with yii is written in the Class Reference.
tags: doc

Using cache in CActiveDataProvider

Created 3 years ago by StammTips7 comments – viewed 16,146 times – ( +21 ) – 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.

The complete beginner's study guide for the Yii Framework

Created 2 years ago by Rodrigo CoelhoTips2 comments – viewed 53,628 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.

Special $variables in CGridView and CListView

Created 3 years ago by Steve FriedlTips11 comments – viewed 48,340 times – ( +27 / -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 4 years ago by WoilTips1 comment – viewed 45,222 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 3 years ago by GOshaTips0 comments – viewed 8,263 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 3 years ago by fsbTips5 comments – viewed 28,620 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.

How to upload image(photo), and path entry in database with update functionality

Created 2 years ago by kiran sharmaTips17 comments – viewed 110,030 times – ( +36 / -3 ) – version 1.1
I saw many posts that community newbie is confuse in image/photo upload with random name. so I post this topic covering all useful things regarding to image/photo upload(not covering image attribute related functionality)

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

Created 3 years ago by JobloTips7 comments – viewed 37,249 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.