Wiki

Sorted by date (updated)X
Displaying 441-450 of 684 result(s).

Enabling Gzip

Updated 2 years ago by Yang HeTutorials5 comments – viewed 16,891 times – ( +5 / -1 ) – version 1.1
Adding HTTP compression to your application could never have been easier!

Use shortcut functions to reduce typing

Updated 2 years ago by Yang HeTutorials8 comments – viewed 38,833 times – ( +54 ) – version 1.1
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 the problem of these lengthy typings, it is worthwhile to define global shortcut functions to some commonly used method calls. They will make the application code look cleaner.

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

Updated 2 years ago by Yang HeTutorials3 comments – viewed 32,676 times – ( +12 ) – version 1.1
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.

Setting and maintaining the language in Application (i18n)

Updated 2 years ago by Yang HeTutorials11 comments – viewed 74,101 times – ( +23 ) – version 1.1
As seen in this post, Yii doesn't enforce how language is set and maintained within the session.
tags: i18n, translation

How to create a breadcrumb widget

Updated 2 years ago by Yang HeTutorials4 comments – viewed 54,913 times – ( +12 ) – version 1.1
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.

How to generate Web feed for an application

Updated 2 years ago by Yang HeTutorials6 comments – viewed 18,425 times – ( +4 ) – version 1.1
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 on how to use other components in Zend Framework.

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

Updated 2 years ago by Yang HeTutorials30 comments – viewed 139,020 times – ( +110 / -1 ) – version 1.1
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:

How to customize Yii core messages?

Updated 2 years ago by Yang HeTutorials7 comments – viewed 40,331 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,357 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 HeTutorials1 comment – viewed 113,236 times – ( +25 ) – 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.