{"action":"created","comment":{"url":"https://api.github.com/repos/yupe/yupe/pulls/comments/44211611","id":44211611,"diff_hunk":"@@ -0,0 +1,28 @@\n+<?php\n+use yupe\\components\\controllers\\FrontController;\n+\n+class ProducerController extends FrontController\n+{\n+    public function actionIndex()\n+    {\n+        $this->render('index', [\n+            'brands' => Producer::model()->getAllDataProvider()\n+        ]);\n+    }\n+\n+    public function actionView($slug)\n+    {\n+        $producer = Producer::model()->getBySlug($slug);\n+\n+        if (!$producer) {\n+            throw new CHttpException(404, Yii::t('StoreModule.store', 'Page was not found!'));\n+        }\n+\n+        $productRepository = Yii::app()->getComponent('productRepository');","path":"protected/modules/store/controllers/ProducerController.php","position":21,"original_position":21,"commit_id":"9739c2ae2d7e8374aef55a2052c93ea60da552a0","original_commit_id":"9739c2ae2d7e8374aef55a2052c93ea60da552a0","user":{"login":"yupe","id":668145,"avatar_url":"https://avatars.githubusercontent.com/u/668145?v=3","gravatar_id":"","url":"https://api.github.com/users/yupe","html_url":"https://github.com/yupe","followers_url":"https://api.github.com/users/yupe/followers","following_url":"https://api.github.com/users/yupe/following{/other_user}","gists_url":"https://api.github.com/users/yupe/gists{/gist_id}","starred_url":"https://api.github.com/users/yupe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yupe/subscriptions","organizations_url":"https://api.github.com/users/yupe/orgs","repos_url":"https://api.github.com/users/yupe/repos","events_url":"https://api.github.com/users/yupe/events{/privacy}","received_events_url":"https://api.github.com/users/yupe/received_events","type":"User","site_admin":false},"body":"Лучше вынести в переменную на уровень класса контроллера и присвоить это все в init().\r\nЕсли указать еще phpdoc с типом - будет работать автокомплит. \r\nКак вот здесь https://github.com/sabian/yupe/blob/2226_brands/protected/modules/store/controllers/ProductController.php#L25 При миграции на Yii2 все из init будет перенесено в механизм DI через конструктор контроллера. Т.е. сейчас, взглянув на init сразу видим от каких компонентов зависит наш контроллер.","created_at":"2015-11-07T12:25:19Z","updated_at":"2015-11-07T12:25:19Z","html_url":"https://github.com/yupe/yupe/pull/2241#discussion_r44211611","pull_request_url":"https://api.github.com/repos/yupe/yupe/pulls/2241","_links":{"self":{"href":"https://api.github.com/repos/yupe/yupe/pulls/comments/44211611"},"html":{"href":"https://github.com/yupe/yupe/pull/2241#discussion_r44211611"},"pull_request":{"href":"https://api.github.com/repos/yupe/yupe/pulls/2241"}}},"pull_request":{"url":"https://api.github.com/repos/yupe/yupe/pulls/2241","id":49955900,"html_url":"https://github.com/yupe/yupe/pull/2241","diff_url":"https://github.com/yupe/yupe/pull/2241.diff","patch_url":"https://github.com/yupe/yupe/pull/2241.patch","issue_url":"https://api.github.com/repos/yupe/yupe/issues/2241","number":2241,"state":"open","locked":false,"title":"Отображение брендов","user":{"login":"sabian","id":434141,"avatar_url":"https://avatars.githubusercontent.com/u/434141?v=3","gravatar_id":"","url":"https://api.github.com/users/sabian","html_url":"https://github.com/sabian","followers_url":"https://api.github.com/users/sabian/followers","following_url":"https://api.github.com/users/sabian/following{/other_user}","gists_url":"https://api.github.com/users/sabian/gists{/gist_id}","starred_url":"https://api.github.com/users/sabian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sabian/subscriptions","organizations_url":"https://api.github.com/users/sabian/orgs","repos_url":"https://api.github.com/users/sabian/repos","events_url":"https://api.github.com/users/sabian/events{/privacy}","received_events_url":"https://api.github.com/users/sabian/received_events","type":"User","site_admin":false},"body":"fixes #2226 \r\n\r\nСделал страницы для просмотра всех брендов и выбранного бренда. В комплекте виджет для показа всех брендов.\r\nСкриншоты того, как это выглядит в новой теме, ниже. В стандартной теме все стандартно.\r\n\r\n![screenshot-yupe loc 2015-11-06 14-13-10](https://cloud.githubusercontent.com/assets/434141/10998558/f1e82afc-84a6-11e5-80c9-483b23afc319.png)\r\n\r\n![brand_page](https://cloud.githubusercontent.com/assets/434141/10998561/f74f80bc-84a6-11e5-8ffa-15d61faf26fb.png)\r\n","created_at":"2015-11-06T13:55:35Z","updated_at":"2015-11-07T12:25:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a0b001a60bbbf10741d46592b3f1a9590b40d1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yupe/yupe/pulls/2241/commits","review_comments_url":"https://api.github.com/repos/yupe/yupe/pulls/2241/comments","review_comment_url":"https://api.github.com/repos/yupe/yupe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yupe/yupe/issues/2241/comments","statuses_url":"https://api.github.com/repos/yupe/yupe/statuses/9739c2ae2d7e8374aef55a2052c93ea60da552a0","head":{"label":"sabian:2226_brands","ref":"2226_brands","sha":"9739c2ae2d7e8374aef55a2052c93ea60da552a0","user":{"login":"sabian","id":434141,"avatar_url":"https://avatars.githubusercontent.com/u/434141?v=3","gravatar_id":"","url":"https://api.github.com/users/sabian","html_url":"https://github.com/sabian","followers_url":"https://api.github.com/users/sabian/followers","following_url":"https://api.github.com/users/sabian/following{/other_user}","gists_url":"https://api.github.com/users/sabian/gists{/gist_id}","starred_url":"https://api.github.com/users/sabian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sabian/subscriptions","organizations_url":"https://api.github.com/users/sabian/orgs","repos_url":"https://api.github.com/users/sabian/repos","events_url":"https://api.github.com/users/sabian/events{/privacy}","received_events_url":"https://api.github.com/users/sabian/received_events","type":"User","site_admin":false},"repo":{"id":30927374,"name":"yupe","full_name":"sabian/yupe","owner":{"login":"sabian","id":434141,"avatar_url":"https://avatars.githubusercontent.com/u/434141?v=3","gravatar_id":"","url":"https://api.github.com/users/sabian","html_url":"https://github.com/sabian","followers_url":"https://api.github.com/users/sabian/followers","following_url":"https://api.github.com/users/sabian/following{/other_user}","gists_url":"https://api.github.com/users/sabian/gists{/gist_id}","starred_url":"https://api.github.com/users/sabian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sabian/subscriptions","organizations_url":"https://api.github.com/users/sabian/orgs","repos_url":"https://api.github.com/users/sabian/repos","events_url":"https://api.github.com/users/sabian/events{/privacy}","received_events_url":"https://api.github.com/users/sabian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sabian/yupe","description":"Юпи! -  CMS на Yiiframework","fork":true,"url":"https://api.github.com/repos/sabian/yupe","forks_url":"https://api.github.com/repos/sabian/yupe/forks","keys_url":"https://api.github.com/repos/sabian/yupe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sabian/yupe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sabian/yupe/teams","hooks_url":"https://api.github.com/repos/sabian/yupe/hooks","issue_events_url":"https://api.github.com/repos/sabian/yupe/issues/events{/number}","events_url":"https://api.github.com/repos/sabian/yupe/events","assignees_url":"https://api.github.com/repos/sabian/yupe/assignees{/user}","branches_url":"https://api.github.com/repos/sabian/yupe/branches{/branch}","tags_url":"https://api.github.com/repos/sabian/yupe/tags","blobs_url":"https://api.github.com/repos/sabian/yupe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sabian/yupe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sabian/yupe/git/refs{/sha}","trees_url":"https://api.github.com/repos/sabian/yupe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sabian/yupe/statuses/{sha}","languages_url":"https://api.github.com/repos/sabian/yupe/languages","stargazers_url":"https://api.github.com/repos/sabian/yupe/stargazers","contributors_url":"https://api.github.com/repos/sabian/yupe/contributors","subscribers_url":"https://api.github.com/repos/sabian/yupe/subscribers","subscription_url":"https://api.github.com/repos/sabian/yupe/subscription","commits_url":"https://api.github.com/repos/sabian/yupe/commits{/sha}","git_commits_url":"https://api.github.com/repos/sabian/yupe/git/commits{/sha}","comments_url":"https://api.github.com/repos/sabian/yupe/comments{/number}","issue_comment_url":"https://api.github.com/repos/sabian/yupe/issues/comments{/number}","contents_url":"https://api.github.com/repos/sabian/yupe/contents/{+path}","compare_url":"https://api.github.com/repos/sabian/yupe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sabian/yupe/merges","archive_url":"https://api.github.com/repos/sabian/yupe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sabian/yupe/downloads","issues_url":"https://api.github.com/repos/sabian/yupe/issues{/number}","pulls_url":"https://api.github.com/repos/sabian/yupe/pulls{/number}","milestones_url":"https://api.github.com/repos/sabian/yupe/milestones{/number}","notifications_url":"https://api.github.com/repos/sabian/yupe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sabian/yupe/labels{/name}","releases_url":"https://api.github.com/repos/sabian/yupe/releases{/id}","created_at":"2015-02-17T17:05:28Z","updated_at":"2015-05-08T10:18:06Z","pushed_at":"2015-11-06T13:51:03Z","git_url":"git://github.com/sabian/yupe.git","ssh_url":"git@github.com:sabian/yupe.git","clone_url":"https://github.com/sabian/yupe.git","svn_url":"https://github.com/sabian/yupe","homepage":"http://yupe-project.ru","size":65656,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yupe:dev","ref":"dev","sha":"235a8e2cb0477f24b492eb7daf5eca5cec52c60b","user":{"login":"yupe","id":668145,"avatar_url":"https://avatars.githubusercontent.com/u/668145?v=3","gravatar_id":"","url":"https://api.github.com/users/yupe","html_url":"https://github.com/yupe","followers_url":"https://api.github.com/users/yupe/followers","following_url":"https://api.github.com/users/yupe/following{/other_user}","gists_url":"https://api.github.com/users/yupe/gists{/gist_id}","starred_url":"https://api.github.com/users/yupe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yupe/subscriptions","organizations_url":"https://api.github.com/users/yupe/orgs","repos_url":"https://api.github.com/users/yupe/repos","events_url":"https://api.github.com/users/yupe/events{/privacy}","received_events_url":"https://api.github.com/users/yupe/received_events","type":"User","site_admin":false},"repo":{"id":1477472,"name":"yupe","full_name":"yupe/yupe","owner":{"login":"yupe","id":668145,"avatar_url":"https://avatars.githubusercontent.com/u/668145?v=3","gravatar_id":"","url":"https://api.github.com/users/yupe","html_url":"https://github.com/yupe","followers_url":"https://api.github.com/users/yupe/followers","following_url":"https://api.github.com/users/yupe/following{/other_user}","gists_url":"https://api.github.com/users/yupe/gists{/gist_id}","starred_url":"https://api.github.com/users/yupe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yupe/subscriptions","organizations_url":"https://api.github.com/users/yupe/orgs","repos_url":"https://api.github.com/users/yupe/repos","events_url":"https://api.github.com/users/yupe/events{/privacy}","received_events_url":"https://api.github.com/users/yupe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yupe/yupe","description":"Юпи! -  CMS на Yiiframework","fork":false,"url":"https://api.github.com/repos/yupe/yupe","forks_url":"https://api.github.com/repos/yupe/yupe/forks","keys_url":"https://api.github.com/repos/yupe/yupe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yupe/yupe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yupe/yupe/teams","hooks_url":"https://api.github.com/repos/yupe/yupe/hooks","issue_events_url":"https://api.github.com/repos/yupe/yupe/issues/events{/number}","events_url":"https://api.github.com/repos/yupe/yupe/events","assignees_url":"https://api.github.com/repos/yupe/yupe/assignees{/user}","branches_url":"https://api.github.com/repos/yupe/yupe/branches{/branch}","tags_url":"https://api.github.com/repos/yupe/yupe/tags","blobs_url":"https://api.github.com/repos/yupe/yupe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yupe/yupe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yupe/yupe/git/refs{/sha}","trees_url":"https://api.github.com/repos/yupe/yupe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yupe/yupe/statuses/{sha}","languages_url":"https://api.github.com/repos/yupe/yupe/languages","stargazers_url":"https://api.github.com/repos/yupe/yupe/stargazers","contributors_url":"https://api.github.com/repos/yupe/yupe/contributors","subscribers_url":"https://api.github.com/repos/yupe/yupe/subscribers","subscription_url":"https://api.github.com/repos/yupe/yupe/subscription","commits_url":"https://api.github.com/repos/yupe/yupe/commits{/sha}","git_commits_url":"https://api.github.com/repos/yupe/yupe/git/commits{/sha}","comments_url":"https://api.github.com/repos/yupe/yupe/comments{/number}","issue_comment_url":"https://api.github.com/repos/yupe/yupe/issues/comments{/number}","contents_url":"https://api.github.com/repos/yupe/yupe/contents/{+path}","compare_url":"https://api.github.com/repos/yupe/yupe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yupe/yupe/merges","archive_url":"https://api.github.com/repos/yupe/yupe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yupe/yupe/downloads","issues_url":"https://api.github.com/repos/yupe/yupe/issues{/number}","pulls_url":"https://api.github.com/repos/yupe/yupe/pulls{/number}","milestones_url":"https://api.github.com/repos/yupe/yupe/milestones{/number}","notifications_url":"https://api.github.com/repos/yupe/yupe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yupe/yupe/labels{/name}","releases_url":"https://api.github.com/repos/yupe/yupe/releases{/id}","created_at":"2011-03-14T08:24:12Z","updated_at":"2015-11-04T20:34:06Z","pushed_at":"2015-11-07T12:21:11Z","git_url":"git://github.com/yupe/yupe.git","ssh_url":"git@github.com:yupe/yupe.git","clone_url":"https://github.com/yupe/yupe.git","svn_url":"https://github.com/yupe/yupe","homepage":"http://yupe-project.ru","size":81508,"stargazers_count":507,"watchers_count":507,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":291,"mirror_url":null,"open_issues_count":75,"forks":291,"open_issues":75,"watchers":507,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yupe/yupe/pulls/2241"},"html":{"href":"https://github.com/yupe/yupe/pull/2241"},"issue":{"href":"https://api.github.com/repos/yupe/yupe/issues/2241"},"comments":{"href":"https://api.github.com/repos/yupe/yupe/issues/2241/comments"},"review_comments":{"href":"https://api.github.com/repos/yupe/yupe/pulls/2241/comments"},"review_comment":{"href":"https://api.github.com/repos/yupe/yupe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yupe/yupe/pulls/2241/commits"},"statuses":{"href":"https://api.github.com/repos/yupe/yupe/statuses/9739c2ae2d7e8374aef55a2052c93ea60da552a0"}}}}