Wiki

Sorted by viewsX
Displaying 11-20 of 597 result(s).

Update content in AJAX with renderPartial

Created 4 years ago by BurzumTutorials15 comments – viewed 150,158 times – ( +56 ) – version 1.1
The easiest way to update content in AJAX is to use the renderPartial method.
tags: AJAX

How to work with flash messages

Created 5 years ago by pfthTutorials9 comments – viewed 138,982 times – ( +57 ) – version 1.1
Set your messages in a controller:

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

Created 5 years ago by qiangTutorials15 comments – viewed 124,645 times – ( +107 / -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 write secure Yii applications

Created 2 years ago by Fran├žois GannazHow-tos19 comments – viewed 123,528 times – ( +97 ) – version 1.1
warning: While this security guide tries to be quite complete, is not exhaustive. If security matters for you, you ought to check several other references.

Understanding the view rendering flow

Created 2 years ago by dckurushinFAQs16 comments – viewed 114,427 times – ( +89 / -3 ) – version 1.1
There is a lot of confusion surrounding what is happening behind the scenes when you render a view.

Searching and sorting by related model in CGridView

Created 2 years ago by redguyTutorials72 comments – viewed 106,769 times – ( +102 ) – version 1.1
Lets say we have two models and relation between them:

Create your own Validation Rule

Created 3 years ago by nickcvHow-tos11 comments – viewed 104,586 times – ( +71 / -3 ) – version 1.1
Some times the core validation rules provided by Yii won't satisfy all your needs, so you'll need to create your very own validation rule.

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

Created 5 years ago by qiangTutorials1 comment – viewed 103,516 times – ( +23 ) – 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.

The directory structure of the Yii project site

Created 3 years ago by qiangOthers37 comments – viewed 102,945 times – ( +80 ) – version 1.1
In this article, we describe the directory structure used by yiiframework.com - the official Yii framework website. While this structure may look overly complicated for small projects or may not be optimal in some sense, we believe it is appropriate for medium or large projects in a team development environment. In fact, we have successfully used the similar structure in some other big projects.
tags: directory, config

Understanding "Assets"

Created 3 years ago by Steve FriedlTutorials11 comments – viewed 99,957 times – ( +57 ) – version 1.1
Many newcomers to Yii ask about the assets/ directory found under the webroot, and this article means to explain why it's there and how to work with it.