{"action":"created","issue":{"url":"https://api.github.com/repos/thephpleague/plates/issues/60","labels_url":"https://api.github.com/repos/thephpleague/plates/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/plates/issues/60/comments","events_url":"https://api.github.com/repos/thephpleague/plates/issues/60/events","html_url":"https://github.com/thephpleague/plates/issues/60","id":55182072,"number":60,"title":"how to avoid undefined variable?","user":{"login":"badpenguin","id":5000272,"avatar_url":"https://avatars.githubusercontent.com/u/5000272?v=3","gravatar_id":"","url":"https://api.github.com/users/badpenguin","html_url":"https://github.com/badpenguin","followers_url":"https://api.github.com/users/badpenguin/followers","following_url":"https://api.github.com/users/badpenguin/following{/other_user}","gists_url":"https://api.github.com/users/badpenguin/gists{/gist_id}","starred_url":"https://api.github.com/users/badpenguin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badpenguin/subscriptions","organizations_url":"https://api.github.com/users/badpenguin/orgs","repos_url":"https://api.github.com/users/badpenguin/repos","events_url":"https://api.github.com/users/badpenguin/events{/privacy}","received_events_url":"https://api.github.com/users/badpenguin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thephpleague/plates/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-22T17:22:19Z","updated_at":"2015-02-18T17:48:04Z","closed_at":null,"body":"I've create an extension of mine to automatically handle missing variables and replacing them with a default value, i.e.\r\n\r\n```\r\n$this->plate->registerFunction('default', [$this, 'extension_default']);\r\n\r\n\tfunction extension_default($var,$def='') {\r\n\t\tif (isset($var)) return $var;\r\n\t\treturn $def;\r\n\t}\r\n```\r\nhowever when using the code in the template i still getting an error message abount the variable being undefined:\r\n```\r\n<html lang=\"<?=$this->default($page_lang,'en')?>\">\r\n```\r\navoidable with @:\r\n```\r\n<html lang=\"<?=@$this->default($page_lang,'en')?>\">\r\n```\r\nIs there a better alternative way to fill up my page with all of those @$this->default() calls?\r\n"},"comment":{"url":"https://api.github.com/repos/thephpleague/plates/issues/comments/74911110","html_url":"https://github.com/thephpleague/plates/issues/60#issuecomment-74911110","issue_url":"https://api.github.com/repos/thephpleague/plates/issues/60","id":74911110,"user":{"login":"chrismichaels84","id":5412413,"avatar_url":"https://avatars.githubusercontent.com/u/5412413?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismichaels84","html_url":"https://github.com/chrismichaels84","followers_url":"https://api.github.com/users/chrismichaels84/followers","following_url":"https://api.github.com/users/chrismichaels84/following{/other_user}","gists_url":"https://api.github.com/users/chrismichaels84/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismichaels84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismichaels84/subscriptions","organizations_url":"https://api.github.com/users/chrismichaels84/orgs","repos_url":"https://api.github.com/users/chrismichaels84/repos","events_url":"https://api.github.com/users/chrismichaels84/events{/privacy}","received_events_url":"https://api.github.com/users/chrismichaels84/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T17:48:04Z","updated_at":"2015-02-18T17:48:04Z","body":"I've submitted a pull request #66 "}}