Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
CostaRico committed Jul 17, 2014
1 parent e68f7ca commit 553c466
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
yii2-images
===========
its only test
Yii2-images is yii2 module that allow attach images to any your model.

You can attach, remove, resize images,
set main image for model

For instance:

<pre>
$model = Model::findOne(12); //Model must have id
$model->attachImage('../../image.png');
$model->attachImage('../../image2.png');

//to get all images
$images = $model->getImages();
foreach($images as $img){
//retun url to full image
echo $img->getUrl();

//return url to proportionally resized image by width
echo $img->getUrl('300x');

//return url to proportionally resized image by height
echo $img->getUrl('x300');

//return url to resized and cropped image by width and height
echo $img->getUrl('200x300');


}
</pre>


Installation:
1) install from json
2) run migration
3) setup module
4) setup behaviour
5) check permissions

0 comments on commit 553c466

Please sign in to comment.