Wiki

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

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

Created 4 years ago by qiangTutorials10 comments – viewed 78,231 times – ( +87 )
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 about a year ago by François GannazHow-tos11 comments – viewed 69,327 times – ( +78 )
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 about a year ago by dckurushinFAQs10 comments – viewed 68,239 times – ( +65 / -1 )
There is a lot of confusion surrounding what is happening behind the scenes when you render a view.

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

Created 4 years ago by qiangTutorials1 comment – viewed 67,392 times – ( +18 )
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 2 years ago by qiangOthers28 comments – viewed 66,944 times – ( +74 )
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 2 years ago by Steve FriedlTutorials11 comments – viewed 64,034 times – ( +52 )
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.

Create your own Validation Rule

Created 2 years ago by nickcvHow-tos8 comments – viewed 62,447 times – ( +58 )
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.

CJuiDialog and AjaxSubmitButton

Created 3 years ago by tydeas_drTutorials18 comments – viewed 60,032 times – ( +32 / -2 )
Hello ppl. Even though i have a small experience with yii I though of writing this to help people which want to do something similar.
tags: AJAX

Searching and sorting by related model in CGridView

Created about a year ago by redguyTutorials49 comments – viewed 59,450 times – ( +77 )
Lets say we have two models and relation between them:

CGridView: Render customized/complex datacolumns

Created about a year ago by JobloTips8 comments – viewed 57,687 times – ( +55 )
If you have to display a overview of related data in a table, you can use the CListView, create your view with table/tr/td tags and implement db-queries in the view to display detaildata of the current (master-)record.
tags: CGridView