Skip to content

Instantly share code, notes, and snippets.

@twslade
Created September 20, 2012 19:49
Show Gist options
  • Save twslade/3757953 to your computer and use it in GitHub Desktop.
Save twslade/3757953 to your computer and use it in GitHub Desktop.
Magento Translating - Very Easy
$vars = array('test' => 'twinkle');
$text = '
I am making a {{var test}}
what if {{depend test2}}this{{/depend}} does not exist
{{if test3}}does if exists{{/if}}
';
$template = new Varien_Filter_Template();
$template->setVariables($vars);
var_dump($template->filter($text));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment