Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.
Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.
In this wiki I will show you how to extends an extension and/or how can two or more extensions work together.
This is a reference to be used for Model rule validation and is compiled from the Yii documentation and code. The purpose is to have all the information gathered in one place instead of scattered. This reference is not an intro. See The Definitive Guide to Yii, Declaring Validation Rules for a tutorial.
This example includes a composite condition as well as an empty condition - as if you bypass or disable defaultScope without using resetScope().
Let's say you have an internal messaging system in your webapp, and you want to display messages dynamically and real-time to the relevant recipients.
We all love the convenient gadget, namely jQuery UI Datepicker as an input element for date. Yii supports it as CJuiDatePicker. Let's see how to use it.
Let's say our table 'mug' has a column named 'color' of the type ENUM('red','green','blue').
We want to replace the textfield for the attribute color in the create and update forms of a 'mug' with a drop down list, which has the enum values as options.
The main code was contributed by zaccaria in the forum (see [this post](...
There are a couple of ways to achieve this, but the first is preferred.
In addition to the opcode cache, APC can also serve as a user cache for Yii via [CApcCache]. It should be noted that this will make APC's memory needs less predictable.
Starting with the blog tutorial, Yii developers are familiar with the notion of access rules defined in the controller, where the actions are allowed or denied depending on the user's name or role.
class CommentController extends CController {
public function filters()
{
return array( 'accessControl' ); // perform access control for CRUD operations
}
>Info: As KCFinder's documentation mentions, if your application (Yii in our case) session handling is using the PHP environment configuration - meaning no change in session handling at all, then no change is needed also on KCFinder side to be able to use this session and thus have this simple interface between your Yii webapp and KCFinder. If t...
We can use a CJuiDatePicker for a CGridView inline filter.
To replace the application component 'format', which is registered by CApplication by default, you can put this in your application 'components' config:
by: Christian Salazar (bluyell, @salazachris74, christiansalazarh@gmail.com)
While rewriting the PcReportContent extension I'm maintaining I've bumped to a challenge. This wiki was born out of it.
Language translation is a common requirement in multi lingual sites. In Yii, we can translate using message and view translation.
There came the need to perform two operations, always, on 'application boot' time. Example? My real world example involved some geo-location logic (that's the first operation) and syncing of some session details so KcFinder can be in sync with the user in context - each user with his own session container (the second).
In some cases, we have to limit the number of page views for the guests users. Yii provide an efficient method to get this.
suppose to have in Mongo a collection "user" like: