{"action":"created","issue":{"url":"https://api.github.com/repos/opencart/opencart/issues/3230","labels_url":"https://api.github.com/repos/opencart/opencart/issues/3230/labels{/name}","comments_url":"https://api.github.com/repos/opencart/opencart/issues/3230/comments","events_url":"https://api.github.com/repos/opencart/opencart/issues/3230/events","html_url":"https://github.com/opencart/opencart/pull/3230","id":99890618,"number":3230,"title":"Breaked down login::index() to several methods. Added global variables to templating.","user":{"login":"smilesrg","id":576284,"avatar_url":"https://avatars.githubusercontent.com/u/576284?v=3","gravatar_id":"","url":"https://api.github.com/users/smilesrg","html_url":"https://github.com/smilesrg","followers_url":"https://api.github.com/users/smilesrg/followers","following_url":"https://api.github.com/users/smilesrg/following{/other_user}","gists_url":"https://api.github.com/users/smilesrg/gists{/gist_id}","starred_url":"https://api.github.com/users/smilesrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smilesrg/subscriptions","organizations_url":"https://api.github.com/users/smilesrg/orgs","repos_url":"https://api.github.com/users/smilesrg/repos","events_url":"https://api.github.com/users/smilesrg/events{/privacy}","received_events_url":"https://api.github.com/users/smilesrg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-09T12:10:27Z","updated_at":"2015-08-10T05:56:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opencart/opencart/pulls/3230","html_url":"https://github.com/opencart/opencart/pull/3230","diff_url":"https://github.com/opencart/opencart/pull/3230.diff","patch_url":"https://github.com/opencart/opencart/pull/3230.patch"},"body":"In this PR I did the following:\r\n\r\n* Break login::index() to several methods. This can help to understand what's going on during the login process, also it could be easier to maintain/make changes.\r\n* There is no need to set $data with language strings: language string can be retrieved in the template by calling ```$lng->get('language_string')```. So all code pieces like ```$data['entry_email'] = $this->language->get('entry_email');``` have been removed from controller.\r\n* Also, ```url``` ```load``` and ```request``` services have been added.\r\n* POST variables can be retrieved directly in the template by calling ```$request->post('variable_name', 'default_value');``` or just ```$request->post('variable_name')```\r\nAll code pieces like below have been removed\r\n```php\r\nif (isset($this->request->post['email'])) {\r\n    $data['email'] = $this->request->post['email'];\r\n} else {\r\n\t$data['email'] = '';\r\n}\r\n ```\r\n"},"comment":{"url":"https://api.github.com/repos/opencart/opencart/issues/comments/129313840","html_url":"https://github.com/opencart/opencart/pull/3230#issuecomment-129313840","issue_url":"https://api.github.com/repos/opencart/opencart/issues/3230","id":129313840,"user":{"login":"smilesrg","id":576284,"avatar_url":"https://avatars.githubusercontent.com/u/576284?v=3","gravatar_id":"","url":"https://api.github.com/users/smilesrg","html_url":"https://github.com/smilesrg","followers_url":"https://api.github.com/users/smilesrg/followers","following_url":"https://api.github.com/users/smilesrg/following{/other_user}","gists_url":"https://api.github.com/users/smilesrg/gists{/gist_id}","starred_url":"https://api.github.com/users/smilesrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smilesrg/subscriptions","organizations_url":"https://api.github.com/users/smilesrg/orgs","repos_url":"https://api.github.com/users/smilesrg/repos","events_url":"https://api.github.com/users/smilesrg/events{/privacy}","received_events_url":"https://api.github.com/users/smilesrg/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T05:56:29Z","updated_at":"2015-08-10T05:56:29Z","body":"And I want to do more - refactor this login controller by using event listener. But this issue really blocks me https://github.com/opencart/opencart/issues/3233 Code parts like restoring customer cart and wishlist, adding activity, overriding admin login and loading default address can be moved to event listeners."}}