instead deprecated \Nette\Environment

Notice: This thread is very old.
alnux
Member | 106
+
0
-

I was using \Nette\Environment to get services and parameters but this now is deprecated, could you help me witch class i have to use to get services and parameters please.

right now im get them as follow

\Nette\Environment::getService('session');

or a parameter value from neon config

$country = \Nette\Environment::getVariables()['location']['countrydefault']

how can i do now

thanks

Last edited by alnux (2014-12-02 01:46)

Šaman
Member | 2506
+
+3
-

Use Dependency injection instead.

alnux
Member | 106
+
0
-

thanks saman but i was reading the doc and it is still confused to me. becouse i want to recover the system container params or services that are created and with \Nette\Environment was easy to get them.

regards