Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.
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.
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.
A lot of people have written posts on integrating Yii and WordPress. This article combines goncin's approach with an article I read about integrating Symfony and WordPress and applies it all to Yii and WordPress.
I saw many posts that community newbie is confuse in image/photo upload with random name.
so I post this topic covering all useful things regarding to image/photo upload(not covering image attribute related functionality)