Wiki articles

Showing 221-240 of 651 items.

How to log changes of ActiveRecords?

Created 15 years ago by pfth, updated 11 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: 72 547 times
Version: 1.1
Category: Tutorials
Tags: Logging

How to filter data using a dropdown list?

Created 15 years ago by qiang, updated 11 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: 41 951 times
Version: 1.1
Category: Tutorials
Tags:

How to setup yiic on WAMP (XP/Vista)

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

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

2 0
5 followers
Viewed: 93 697 times
Version: 1.1
Category: Tutorials
Tags:

First Yii App: CTabView

Created 15 years ago by meanpenguin, updated 11 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: 27 595 times
Version: 1.1
Category: Tutorials
Tags:

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

Created 15 years ago by qiang, updated 11 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: 226 592 times
Version: 1.1
Category: Tutorials

AutoTimestampBehavior

Created 15 years ago by jonah, updated 11 years ago by Yang He.

This behavior will automatically set timestamp fields to the row creation and modification times.

2 2
3 followers
Viewed: 22 589 times
Version: 1.1
Category: Tutorials
Tags:

How to customize Yii core messages?

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

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:

17 0
16 followers
Viewed: 67 801 times
Version: 1.1
Category: Tutorials

How to use a single form to collect data for two or more models?

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

Assume we want to use a single HTML form to collect input for both model A and model B, and we want to display input errors (if any) in the same error summary box. We can define the following action code:

88 0
79 followers
Viewed: 332 098 times
Version: 1.1
Category: Tutorials

How to generate Web feed for an application

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

Web feed is a data format used for providing users with frequently updated content. In this article, we describe how to use Zend_Feed, an excellent component from Zend Framework to generate Web feed for an Yii application. This article can also serve as a general guide...

3 0
9 followers
Viewed: 37 317 times
Version: 1.1
Category: Tutorials
Tags:

How to create a breadcrumb widget

Created 15 years ago by knut, updated 11 years ago by Yang He.

Here's a simple way to create a breadcrumb widget to be used in your templates. The idea is just to isolate how the breadcrumb is generated based on an array of crumbs.

10 0
11 followers
Viewed: 83 883 times
Version: 1.1
Category: Tutorials
Tags:

Setting and maintaining the language in Application (i18n)

Created 15 years ago by olafure, updated 11 years ago by Yang He.

As seen in this post, Yii doesn't enforce how language is set and maintained within the session.

19 0
29 followers
Viewed: 124 631 times
Version: 1.1
Category: Tutorials

How to create/save more Model inputs and make them repeatable with jQuery

Created 14 years ago by qiang, updated 11 years ago by Yang He.

This is the first real problem that I encountered using Yii, trying to make a Model input repeatable in the form, validate and save them.

11 0
16 followers
Viewed: 51 409 times
Version: 1.1
Category: Tutorials
Tags:

Use shortcut functions to reduce typing

Created 14 years ago by qiang, updated 11 years ago by Yang He.

Because Yii intends to be integrated nicely with third-party libraries, it does not define any global functions. Everything in Yii needs to be addressed with full class name or object scopes. For example, to access the current user, we need to use Yii::app()->user; to access application parameters, we need Yii::app()->params['name']; and so on. While editors like textmate can help alleviate...

46 0
45 followers
Viewed: 66 717 times
Version: 1.1
Category: Tutorials
Tags:

Enabling Gzip

Created 14 years ago by pestaa, updated 11 years ago by Yang He.

Adding HTTP compression to your application could never have been easier!

6 1
13 followers
Viewed: 38 779 times
Version: 1.1
Category: Tutorials
Tags:

Adding login form to each page

Created 14 years ago by pestaa, updated 11 years ago by Yang He.

After adding proper form to the main layout, like:

3 1
7 followers
Viewed: 49 441 times
Version: 1.1
Category: Tutorials

How to add ajax-loading indicators

Created 14 years ago by schmunk, updated 11 years ago by Yang He.

With yii you're able to create ajax requests and updates easily. But most times you always want to show a loading indicatior to your user.

23 0
25 followers
Viewed: 75 681 times
Version: 1.1
Category: Tutorials
Tags: AJAX

How to use default layout for error pages instead of errorXXX views

Created 14 years ago by idle sign, updated 11 years ago by Yang He.

The issue is covered in "The Definite Guide to Yii" (Error Handling - Handling Errors Using an Action).

4 0
3 followers
Viewed: 43 052 times
Version: 1.1
Category: Tutorials
Tags:

Encapsulate db and module configurations

Created 14 years ago by ricardograna, updated 11 years ago by Yang He.

This method was inspirated on the excellent text about different environments available at http://www.yiiframework.com/doc/cookbook/32/

7 0
9 followers
Viewed: 20 318 times
Version: 1.1
Category: Tutorials
Tags: module

Using search engine and user friendly URLs

Created 14 years ago by qiang, updated 11 years ago by Yang He.

The Definitive Guide introduces the fundamentals of managing URLs in a Yii application. In this tutorial, we introduce a practical technique that can quickly turn your application into using search-engine-friendly URLs.

19 0
31 followers
Viewed: 101 792 times
Version: 1.1
Category: Tutorials
Tags: SEO, URL

Using the configuration file, explain what can be configured.

Created 14 years ago by atrandafir, updated 11 years ago by Yang He.

The purpose of this post is to let anyone quickly find how to accomplish a configuration task, and list here all the posibilities of the config.php file and also link to pages that explain how is each thing implemented.

17 0
14 followers
Viewed: 90 853 times
Version: 1.1
Category: Tutorials
Tags: