I want create ImageBehavior
for uploading and saving images. My behavior have two fields: imagePath
and imageField
. In my model i'm wrote:
- public function behaviors(){
- return array(
- 'imageBehavior' => array(
- 'class' => 'ImageBehavior',
- 'imagePath' => 'images/avatar-pics/'.$this->user->username,
- 'imageField' => 'avatar',
- ),
- );
- }
but this doesn't worked - i receive path -
images/avatar-pics//image.png
What a solution? Create in behavior field imageFolder
and add to config 'imageFolder' => 'user->username'
? Thanks.