{"action":"closed","issue":{"url":"https://api.github.com/repos/roboapp/variable/issues/4","repository_url":"https://api.github.com/repos/roboapp/variable","labels_url":"https://api.github.com/repos/roboapp/variable/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/roboapp/variable/issues/4/comments","events_url":"https://api.github.com/repos/roboapp/variable/issues/4/events","html_url":"https://github.com/roboapp/variable/issues/4","id":156306074,"number":4,"title":"Settings API","user":{"login":"iRipVanWinkle","id":1456824,"avatar_url":"https://avatars.githubusercontent.com/u/1456824?v=3","gravatar_id":"","url":"https://api.github.com/users/iRipVanWinkle","html_url":"https://github.com/iRipVanWinkle","followers_url":"https://api.github.com/users/iRipVanWinkle/followers","following_url":"https://api.github.com/users/iRipVanWinkle/following{/other_user}","gists_url":"https://api.github.com/users/iRipVanWinkle/gists{/gist_id}","starred_url":"https://api.github.com/users/iRipVanWinkle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iRipVanWinkle/subscriptions","organizations_url":"https://api.github.com/users/iRipVanWinkle/orgs","repos_url":"https://api.github.com/users/iRipVanWinkle/repos","events_url":"https://api.github.com/users/iRipVanWinkle/events{/privacy}","received_events_url":"https://api.github.com/users/iRipVanWinkle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-23T15:49:50Z","updated_at":"2016-05-23T22:49:50Z","closed_at":"2016-05-23T22:49:50Z","body":"To configure API uses a special class settings.\r\n\r\nIn config:\r\n```\r\n'components' => [\r\n ...\r\n      'variable-settings' => [\r\n            'class' => 'VariableConfig',\r\n            ...\r\n      ]\r\n...\r\n]\r\n```\r\n\r\nIn API:\r\n\r\n```\r\nclass Variable {\r\n     const COMPONENT_SETTINGS = 'variable-settings';\r\n ...\r\n      function __construct(){\r\n             self::config();\r\n      }\r\n\r\n      static function config($component = self::COMPONENT_SETTINGS){\r\n            $this->settings = Yii::$app->get($component);\r\n      }\r\n...\r\n]\r\n```\r\n\r\n"}}
{"actor":{"display_login":"iRipVanWinkle"}}