Skip to content

Instantly share code, notes, and snippets.

@sun
Created September 4, 2012 02:47
Show Gist options
  • Save sun/3615986 to your computer and use it in GitHub Desktop.
Save sun/3615986 to your computer and use it in GitHub Desktop.
Translatable config strings
$yaml = Yaml::dump('sun.settings.yml'):
id: my_settings
label: !!php/object:O:1:"t":1:{s:9:"*string";s:12:"Translate me";}
var_dump($parsed = Yaml::parse($yaml)):
array(2) {
["id"]=>
string(11) "my_settings"
["label"]=>
object(t)#34 (1) {
["string":protected]=>
string(12) "Translate me"
}
}
$yaml = Yaml::dump($parsed);
id: my_settings
label: !!php/object:O:1:"t":1:{s:9:"*string";s:12:"Translate me";}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment