{"action":"created","issue":{"url":"https://api.github.com/repos/PendalF89/yii2-filemanager/issues/8","labels_url":"https://api.github.com/repos/PendalF89/yii2-filemanager/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/PendalF89/yii2-filemanager/issues/8/comments","events_url":"https://api.github.com/repos/PendalF89/yii2-filemanager/issues/8/events","html_url":"https://github.com/PendalF89/yii2-filemanager/issues/8","id":67218871,"number":8,"title":"Problem with routes.","user":{"login":"Godscreature","id":10963629,"avatar_url":"https://avatars.githubusercontent.com/u/10963629?v=3","gravatar_id":"","url":"https://api.github.com/users/Godscreature","html_url":"https://github.com/Godscreature","followers_url":"https://api.github.com/users/Godscreature/followers","following_url":"https://api.github.com/users/Godscreature/following{/other_user}","gists_url":"https://api.github.com/users/Godscreature/gists{/gist_id}","starred_url":"https://api.github.com/users/Godscreature/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Godscreature/subscriptions","organizations_url":"https://api.github.com/users/Godscreature/orgs","repos_url":"https://api.github.com/users/Godscreature/repos","events_url":"https://api.github.com/users/Godscreature/events{/privacy}","received_events_url":"https://api.github.com/users/Godscreature/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-08T20:58:49Z","updated_at":"2015-04-15T06:34:35Z","closed_at":null,"body":"Hello. Thank you for this great module!\r\n\r\nI started to learn yii2 a few week ago. I never using this framework (yii1) never before. Excuse me if I writing something stupid..\r\n\r\n In my project this module has one problem. With routes...\r\nI use Yii2 advanced. I included this filemanager in backend. I tried to configured common/config/main.php:\r\n\r\n    'modules' => [\r\n        'filemanager' => [\r\n            'class' => 'pendalf89\\filemanager\\Module',\r\n            // Upload routes\r\n            'routes' => [\r\n                // Base absolute path to web directory\r\n                'baseUrl' => '',\r\n                // Base web directory url\r\n                'basePath' => '@frontend/web/images/',\r\n                // Path for uploaded files in web directory\r\n                'uploadPath' => 'uploads',\r\n            ],\r\n            // Thumbnails info\r\n            'thumbs' => [\r\n                'small' => [\r\n                    'name' => 'Small',\r\n                    'size' => [100, 100],\r\n                ],\r\n                'medium' => [\r\n                    'name' => 'Medium',\r\n                    'size' => [300, 200],\r\n                ],\r\n                'large' => [\r\n                    'name' => 'Big',\r\n                    'size' => [500, 400],\r\n                ],\r\n            ],\r\n        ],\r\n    ]\r\n\r\nBut images not showing. Image files - has writed to database, has uploaded to path which I configured - '/frontend/web/images/uploads/YYYY/MM'. And I have a field 'url' in database = '/uploads/2015/04/mestoraspolozhenie-xolodilnika.jpg' for example, but folder with my image is '/frontend/web/images/uploads/2015/04/mestoraspolozhenie-xolodilnika.jpg', so I added something to config in my backend/config/main.php:\r\n\r\n    'modules' => [\r\n        'filemanager' => [\r\n            'routes' => [\r\n                'content_image_path' => '/frontend/web/images',\r\n            ],\r\n        ],\r\n    ],\r\n\r\nand I included this in two methods of models/Mediafile.php:\r\n\r\nmethod №1: getDefaultThumbUrl\r\npublic function getDefaultThumbUrl($baseUrl = '')\r\n{\r\n// ....... code ......\r\n// standart code:\r\n// return \"$dirname/$filename-{$width}x{$height}.$extension\";\r\n// my code:\r\nreturn Yii::$app->getModule('filemanager')->routes['content_image_path'].\"$dirname/$filename-{$width}x{$height}.$extension\";\r\n}\r\n\r\nmethod №2: getImagesList\r\npublic function getImagesList(Module $module)\r\n{\r\n// ....... code ......\r\nforeach ($thumbs as $alias => $url) {\r\n  $preset = $module->thumbs[$alias];\r\n  // standart code:\r\n  // $list[$url] = $preset['name'] . ' ' . $preset['size'][0] . ' × ' . $preset['size'][1];\r\n  // my code:\r\n  $list[$module->routes['content_image_path'].$url] = $preset['name'] . ' ' . $preset['size'][0] . ' × ' . $preset['size'][1];\r\n}\r\n\r\n$originalImageSize = $this->getOriginalImageSize($module->routes);\r\n// standart code:\r\n// $list[$this->url] = Module::t('main', 'Original') . ' ' . $originalImageSize;\r\n// my code:\r\n$list[$module->routes['content_image_path'].$this->url] = Module::t('main', 'Original') . ' ' . $originalImageSize;\r\nreturn $list;\r\n}\r\n\r\nAfter this manipulations the problem is gone. I hope so....\r\n\r\nExcuse me, friend, if something wrong. It's my first Issue)))."},"comment":{"url":"https://api.github.com/repos/PendalF89/yii2-filemanager/issues/comments/93218525","html_url":"https://github.com/PendalF89/yii2-filemanager/issues/8#issuecomment-93218525","issue_url":"https://api.github.com/repos/PendalF89/yii2-filemanager/issues/8","id":93218525,"user":{"login":"Godscreature","id":10963629,"avatar_url":"https://avatars.githubusercontent.com/u/10963629?v=3","gravatar_id":"","url":"https://api.github.com/users/Godscreature","html_url":"https://github.com/Godscreature","followers_url":"https://api.github.com/users/Godscreature/followers","following_url":"https://api.github.com/users/Godscreature/following{/other_user}","gists_url":"https://api.github.com/users/Godscreature/gists{/gist_id}","starred_url":"https://api.github.com/users/Godscreature/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Godscreature/subscriptions","organizations_url":"https://api.github.com/users/Godscreature/orgs","repos_url":"https://api.github.com/users/Godscreature/repos","events_url":"https://api.github.com/users/Godscreature/events{/privacy}","received_events_url":"https://api.github.com/users/Godscreature/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T06:34:35Z","updated_at":"2015-04-15T06:34:35Z","body":"А что, все файлы вперемешку бросать в одну папку?"}}