{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6129","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-framework","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6129/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6129/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6129/events","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/6129","id":180481638,"number":6129,"title":"Can't add Extension to ViewableData","user":{"login":"jonom","id":1079425,"avatar_url":"https://avatars.githubusercontent.com/u/1079425?v=3","gravatar_id":"","url":"https://api.github.com/users/jonom","html_url":"https://github.com/jonom","followers_url":"https://api.github.com/users/jonom/followers","following_url":"https://api.github.com/users/jonom/following{/other_user}","gists_url":"https://api.github.com/users/jonom/gists{/gist_id}","starred_url":"https://api.github.com/users/jonom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonom/subscriptions","organizations_url":"https://api.github.com/users/jonom/orgs","repos_url":"https://api.github.com/users/jonom/repos","events_url":"https://api.github.com/users/jonom/events{/privacy}","received_events_url":"https://api.github.com/users/jonom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/affects/v3","name":"affects/v3","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2016-10-01T21:35:06Z","updated_at":"2016-10-16T13:25:11Z","closed_at":"2016-10-16T13:25:11Z","body":"I want to make some methods available to all templates, so tried to add these to ViewableData. It doesn't work though, whether adding through PHP or config layer, the methods cannot be accessed, either directly or in templates. If I add the extension to the Controller class instead that works fine. Controller extends from ViewableData so I can't work out what's going on here.\r\n\r\nWorks:\r\n`Controller::add_extension('MyExtension');`\r\n\r\nDoesn't work:\r\n`ViewableData::add_extension('MyExtension');`\r\n\r\nI don't really want to settle for adding this to the Controller class as I want the methods to be available in emails etc. too, and it seems like this _should_ work.\r\n\r\nAm I missing something here?"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/254046772","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/6129#issuecomment-254046772","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6129","id":254046772,"user":{"login":"dhensby","id":563596,"avatar_url":"https://avatars.githubusercontent.com/u/563596?v=3","gravatar_id":"","url":"https://api.github.com/users/dhensby","html_url":"https://github.com/dhensby","followers_url":"https://api.github.com/users/dhensby/followers","following_url":"https://api.github.com/users/dhensby/following{/other_user}","gists_url":"https://api.github.com/users/dhensby/gists{/gist_id}","starred_url":"https://api.github.com/users/dhensby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhensby/subscriptions","organizations_url":"https://api.github.com/users/dhensby/orgs","repos_url":"https://api.github.com/users/dhensby/repos","events_url":"https://api.github.com/users/dhensby/events{/privacy}","received_events_url":"https://api.github.com/users/dhensby/received_events","type":"User","site_admin":false},"created_at":"2016-10-16T13:25:11Z","updated_at":"2016-10-16T13:25:11Z","body":"docs merged"}}
{"actor":{"display_login":"dhensby"}}