Wiki articles

Showing 641-651 of 651 items.

How to filter data using a dropdown list?

Created 15 years ago by qiang, updated 12 years ago by Yang He.

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.

7 0
6 followers
Viewed: 42 797 times
Version: 1.1
Category: Tutorials
Tags:

How to automate timestamps in ActiveRecord models

Created 15 years ago by dalip, updated 12 years ago by Yang He.

There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:

26 0
34 followers
Viewed: 180 477 times
Version: 1.1
Category: Tutorials
Tags:

How to log changes of ActiveRecords?

Created 15 years ago by pfth, updated 12 years ago by Yang He.

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 ActiveRecor...

31 1
47 followers
Viewed: 74 053 times
Version: 1.1
Category: Tutorials
Tags: Logging

Advanced CTabView using CClipWidget

Created 15 years ago by krillzip, updated 12 years ago by Yang He.

Here is a way to dynamically extend tabs based on clips.
Probably even more complex things could be done.

2 0
2 followers
Viewed: 18 797 times
Version: 1.1
Category: Tutorials
Tags:

Q: My yiic tool cannot run model and crud commands. Why?

Created 15 years ago by qiang, updated 15 years ago by mishhh.

Some PHP installations may use a different php.ini file for CLI PHP (command line PHP parser). As a result, when running the model or crud command in yiic shell, you may encounter errors like "YiiBase::include(PDO.php): failed to open stream..." or "...could not find driver", even though the requirement checker confirms you have PDO and the corresponding database driver.

0 0
1 follower
Viewed: 15 497 times
Version: 1.1
Category: Tutorials
Tags:

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

Created 15 years ago by qiang, updated 12 years ago by Yang He.

By default, the expression Yii::app()->user returns a [CWebUser] [application component](http://www.yiiframework.com/doc/guide/basics.application#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|CWebUser::name] property th...

21 0
28 followers
Viewed: 228 479 times
Version: 1.1
Category: Tutorials

First Yii App: CTabView

Created 15 years ago by meanpenguin, updated 12 years ago by Yang He.

Once you are completed with the "Creating First Yii Application", the following can be done.

0 2
1 follower
Viewed: 28 246 times
Version: 1.1
Category: Tutorials
Tags:

How to setup FCKeditor

Created 15 years ago by krillzip, updated 12 years ago by Dark-Sun.

Next to do is to download the Yii FCKeditor extension, created by Ascomae. Extract the downloaded file, and place the fckeditor/ widget folder in your web applications protected/extensions/ directory.

3 1
5 followers
Viewed: 32 063 times
Version: 1.1
Category: Tutorials
Tags:

How to setup yiic on WAMP (XP/Vista)

Created 15 years ago by krillzip, updated 12 years ago by Yang He.

This page assumes that you have installed Wampserver on your MS Windows computer.

2 0
5 followers
Viewed: 94 936 times
Version: 1.1
Category: Tutorials
Tags:

How to upload a file using a model

Created 15 years ago by qiang, updated 9 years ago by samdark.

First declare an attribute to store the file name in the model class (either a form model or an active record model). Also declare a file validation rule for this attribute to ensure a file is uploaded with specific extension name.

66 4
64 followers
Viewed: 519 529 times
Version: 1.1
Category: Tutorials

How to customize the error message of a validation rule

Created 15 years ago by qiang, updated 12 years ago by Yang He.

Validators extending from [CValidator] all have a property named [message|CValidator::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:

13 0
14 followers
Viewed: 145 685 times
Version: 1.1
Category: Tutorials
Tags: