CostaRico / yii2-images

Yii2-images - behavior-based module for resizing, storing, caching and attaching images.
160 stars 98 forks source link

Add ability to specify image model class in behavior #1

Closed vollossy closed 10 years ago

vollossy commented 10 years ago

I think, it's not quite good for extensibility to have such strong couple in ImageBehavior:

$image = new models\Image;
$image->itemId = $this->owner->id;
$image->filePath = $pictureSubDir . '/' . $pictureFileName;
$image->modelName = $this->getModule()->getShortClass($this->owner);

So, we could specify model class in Behavior params and ask this class to implement some required interface.

CostaRico commented 10 years ago

Thx a lot! I'll try to do it. If you have other recommendations lets me know, pls.

vollossy commented 10 years ago

@CostaRico of course, I'll try to create pull request related to this issue when i'll have free time

vollossy commented 10 years ago

@CostaRico could you assign this issue to me?

CostaRico commented 10 years ago

Thx a lot!