{"action":"created","issue":{"url":"https://api.github.com/repos/zxbodya/yii2-gallery-manager/issues/17","repository_url":"https://api.github.com/repos/zxbodya/yii2-gallery-manager","labels_url":"https://api.github.com/repos/zxbodya/yii2-gallery-manager/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/zxbodya/yii2-gallery-manager/issues/17/comments","events_url":"https://api.github.com/repos/zxbodya/yii2-gallery-manager/issues/17/events","html_url":"https://github.com/zxbodya/yii2-gallery-manager/issues/17","id":107319993,"number":17,"title":"it can not upload photos yii2 basic","user":{"login":"gorsargsyan","id":9119897,"avatar_url":"https://avatars.githubusercontent.com/u/9119897?v=3","gravatar_id":"","url":"https://api.github.com/users/gorsargsyan","html_url":"https://github.com/gorsargsyan","followers_url":"https://api.github.com/users/gorsargsyan/followers","following_url":"https://api.github.com/users/gorsargsyan/following{/other_user}","gists_url":"https://api.github.com/users/gorsargsyan/gists{/gist_id}","starred_url":"https://api.github.com/users/gorsargsyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gorsargsyan/subscriptions","organizations_url":"https://api.github.com/users/gorsargsyan/orgs","repos_url":"https://api.github.com/users/gorsargsyan/repos","events_url":"https://api.github.com/users/gorsargsyan/events{/privacy}","received_events_url":"https://api.github.com/users/gorsargsyan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":40,"created_at":"2015-09-19T08:53:50Z","updated_at":"2016-02-22T15:08:29Z","closed_at":null,"body":"![untitled](https://cloud.githubusercontent.com/assets/9119897/9975433/26117016-5ec5-11e5-963e-9c522d0047ff.png)\r\n//my is Migration\r\n\r\n<pre>\r\n<?php\r\n\r\nuse yii\\db\\Schema;\r\nuse yii\\db\\Migration;\r\n\r\nclass m150919_071520_imggallery extends Migration\r\n{\r\n     public $tableName = '{{%imggallery}}';\r\n    public function up()\r\n    {\r\n        $this->createTable(\r\n        $this->tableName,\r\n        array(\r\n        'id' => Schema::TYPE_PK,\r\n        'type' => Schema::TYPE_STRING,\r\n        'ownerId' => Schema::TYPE_STRING . ' NOT NULL',\r\n        'rank' => Schema::TYPE_INTEGER . ' NOT NULL DEFAULT 0',\r\n        'name' => Schema::TYPE_STRING,\r\n        'description' => Schema::TYPE_TEXT\r\n        )\r\n        );\r\n    }\r\n    public function down()\r\n    {\r\n        $this->dropTable($this->tableName);\r\n    }\r\n}\r\n</pre>\r\n\r\naction is \r\n\r\n<pre>\r\n     public function actions()\r\n    {\r\n        return [\r\n           'galleryApi' => [\r\n               'class' => GalleryManagerAction::className(),\r\n               // mappings between type names and model classes (should be the same as in behaviour)\r\n               'types' => [\r\n                   'imggallery' => Imggallery::className()\r\n               ]\r\n           ],\r\n        ];\r\n    }\r\n</pre>\r\n\r\n//model behavior is\r\n\r\n<pre>\r\n public function behaviors()\r\n    {\r\n        return [\r\n             'galleryBehavior' => [\r\n                 'class' => GalleryBehavior::className(),\r\n                 'type' => 'imggallery',\r\n                 'extension' => 'jpg',\r\n                 'directory' => Yii::getAlias('@webroot') . '/uploads',\r\n                 'url' => Yii::getAlias('@webroot') . '/uploads',\r\n                 'versions' => [\r\n                     'small' => function ($img) {\r\n                         /** @var ImageInterface $img */\r\n                         return $img\r\n                             ->copy()\r\n                             ->thumbnail(new Box(200, 200));\r\n                     },\r\n                     'medium' => function ($img) {\r\n                         /** @var ImageInterface $img */\r\n                         $dstSize = $img->getSize();\r\n                         $maxWidth = 800;\r\n                         if ($dstSize->getWidth() > $maxWidth) {\r\n                             $dstSize = $dstSize->widen($maxWidth);\r\n                         }\r\n                         return $img\r\n                             ->copy()\r\n                             ->resize($dstSize);\r\n                     },\r\n                 ]\r\n             ]\r\n        ];\r\n    }\r\n</pre>\r\n\r\nview _form is\r\n\r\n<pre>\r\n   if ($model->isNewRecord) {\r\n            echo 'Can not upload images for new record';\r\n        } else {\r\n            echo GalleryManager::widget(\r\n                [\r\n                    'model' => $model,\r\n                    'behaviorName' => 'galleryBehavior',\r\n                    'apiRoute' => 'imggallery/galleryApi'\r\n                ]\r\n            );\r\n        }\r\n</pre>\r\n\r\nwhen i update the form  it looks like this\r\n![untitled1](https://cloud.githubusercontent.com/assets/9119897/9975480/44181906-5ec6-11e5-9013-1a766124702a.png)\r\n"},"comment":{"url":"https://api.github.com/repos/zxbodya/yii2-gallery-manager/issues/comments/187222975","html_url":"https://github.com/zxbodya/yii2-gallery-manager/issues/17#issuecomment-187222975","issue_url":"https://api.github.com/repos/zxbodya/yii2-gallery-manager/issues/17","id":187222975,"user":{"login":"loy123","id":17383034,"avatar_url":"https://avatars.githubusercontent.com/u/17383034?v=3","gravatar_id":"","url":"https://api.github.com/users/loy123","html_url":"https://github.com/loy123","followers_url":"https://api.github.com/users/loy123/followers","following_url":"https://api.github.com/users/loy123/following{/other_user}","gists_url":"https://api.github.com/users/loy123/gists{/gist_id}","starred_url":"https://api.github.com/users/loy123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loy123/subscriptions","organizations_url":"https://api.github.com/users/loy123/orgs","repos_url":"https://api.github.com/users/loy123/repos","events_url":"https://api.github.com/users/loy123/events{/privacy}","received_events_url":"https://api.github.com/users/loy123/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T15:08:29Z","updated_at":"2016-02-22T15:08:29Z","body":"Now images are display thank you"}}