Skip to content

Instantly share code, notes, and snippets.

@daum
Created April 27, 2016 17:48
Show Gist options
  • Save daum/2c8c314aee01d50d7350e32d2c736fcc to your computer and use it in GitHub Desktop.
Save daum/2c8c314aee01d50d7350e32d2c736fcc to your computer and use it in GitHub Desktop.
<?php
public function __call($method, $arguments)
{
// If arguments are passed can't use the property accessor, so no free obj.name in twig.
if(count($arguments))
return $this->proxyCurrentLocaleTranslation($method, $arguments);
else
return \Symfony\Component\PropertyAccess\PropertyAccess::createPropertyAccessor()->getValue($this->translate(), $method);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment