-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Možnost escapovat tečku v cestě v config.neon #1247
base: master
Are you sure you want to change the base?
Conversation
What's wrong with this?
|
Do not use dots but underscores |
Basically nothing, but that creates another configuration structure. Sometimes you might for some reason want to have periods in configuration keys. And since there is this possibility, there could be also possibility to address these keys with %references%. |
If so, |
@@ -63,7 +63,9 @@ public static function expand($var, array $params, $recursive = FALSE) | |||
throw new Nette\InvalidArgumentException('Circular reference detected for variables: ' . implode(', ', array_keys($recursive)) . '.'); | |||
|
|||
} else { | |||
$val = Nette\Utils\Arrays::get($params, explode('.', $part)); | |||
$partSplit = preg_split('#(?<!\.)\.(?!\.)#i', $part); | |||
array_walk($partSplit, function(&$segment) { $segment = preg_replace('#\.{2}#i', '.', $segment); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
array_map
is better.
Wouldn't be better instead of escaping dots that separate numbers use array indexes? |
991ba1a
to
e23de7a
Compare
489cca2
to
0b969cd
Compare
09a7d92
to
b9698a8
Compare
5a8c108
to
3aa3147
Compare
5feee0e
to
3fc1e40
Compare
dd64e07
to
688f189
Compare
7215ae6
to
71b2047
Compare
Možnost v config.neon v %odkazu% escapovat tečku druhou tečkou, pokud jsou po cestě klíče obsahující tečku.