Wiki

Sorted by date (updated)X
Displaying 461-470 of 696 result(s).

How to customize Yii core messages?

Updated 2 years ago by Yang HeTutorials7 comments – viewed 41,919 times – ( +17 ) – version 1.1
Yii core messages refer to static text strings in the core Yii framework code which are meant to be displayed to end-users (e.g. core exception messages, default validation error messages). Customization of these core messages is needed in two circumstances:

AutoTimestampBehavior

Updated 2 years ago by Yang HeTutorials1 comment – viewed 10,622 times – ( +2 / -2 ) – version 1.1
Note: currently a variant of this class CTimestampBehavior is included into Yii distribution package.

How to add more information to Yii::app()->user

Updated 2 years ago by Yang HeTutorials2 comments – viewed 118,204 times – ( +26 ) – version 1.1
By default, the expression Yii::app()->user returns a CWebUser application component which represents the information that are closely related with the current user. Some information can be persistent throughout the current user session. For example, CWebUser already comes with a name property that stores the username of the current user.

First Yii App: CTabView

Updated 2 years ago by Yang HeTutorials1 comment – viewed 17,227 times – ( -2 ) – version 1.1
Once you are completed with the "Creating First Yii Application", the following can be done.

How to setup yiic on WAMP (XP/Vista)

Updated 2 years ago by Yang HeTutorials3 comments – viewed 67,378 times – ( +2 ) – version 1.1
This page assumes that you have installed Wampserver on your MS Windows computer.

How to filter data using a dropdown list?

Updated 2 years ago by Yang HeTutorials0 comments – viewed 23,549 times – ( +6 ) – version 1.1
A dropdown list can be used to select a value, based on which we can filter the data to be displayed. For example, the extension page has a dropdown list to filter the displayed extensions according to the selected category.

How to log changes of ActiveRecords?

Updated 2 years ago by Yang HeTutorials7 comments – viewed 32,839 times – ( +37 / -2 ) – version 1.1
A simple and effective way to keep track what your users are doing within your application is to log their activities related to database modifications. You can log whenever a record was inserted, changed or deleted, and also when and by which user this was done. For a CActiveRecord Model you could use a behavior for this purpose. This way you will be able to add log functionality to ActiveRecords very easily.
tags: Logging

How to automate timestamps in ActiveRecord models

Updated 2 years ago by Yang HeTutorials8 comments – viewed 102,039 times – ( +30 ) – version 1.1
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:

How to customize the error message of a validation rule

Updated 2 years ago by Yang HeTutorials4 comments – viewed 58,951 times – ( +17 / -1 ) – version 1.1
Validators extending from CValidator all have a property named message. You can set this property in the corresponding validation rule to customize the error message. For example, the following validation rule uses an error message that is different from the default one:

Advanced CTabView using CClipWidget

Updated 2 years ago by Yang HeTutorials1 comment – viewed 10,239 times – ( +2 ) – version 1.1
Here is a way to dynamically extend tabs based on clips. Probably even more complex things could be done.