Wiki

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

PHPStorm & NetBeans autocomplete problem

Created 3 years ago by StagelineTips3 comments – viewed 12,475 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 5 years ago by zaccariaTips0 comments – viewed 7,679 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 3 years ago by Rodrigo CoelhoTips2 comments – viewed 78,417 times – ( +21 ) – 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 5 years ago by StammTips7 comments – viewed 19,759 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.

htmlOptions explained for various controls.

Created 5 years ago by WoilTips1 comment – viewed 53,201 times – ( +18 ) – 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:

Yii 2 list of path aliases available with default basic and advanced app.

Created 2 years ago by Kartik VTips2 comments – viewed 66,369 times – ( +52 / -5 ) – version 2.0
If you are coming over from Yii 1.x to Yii 2, and already read this guide, you may note that namespaces are very important in Yii 2 to identify classes. But do you know the list of seeded path aliases that come shipped with a basic or advanced app? Here is my attempt to list them.

Understanding series articles

Created 4 years ago by GOshaTips0 comments – viewed 9,322 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 4 years ago by fsbTips5 comments – viewed 36,101 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 4 years ago by kiran sharmaTips22 comments – viewed 155,281 times – ( +37 / -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)

FORM with GET method causes repeated stacking of URL Parameters

Created 2 years ago by Kartik VTips2 comments – viewed 20,205 times – ( +43 / -4 ) – version all
You are using an ActiveForm in yii (both v1.x or 2), with a GET method like below: