Tools_Context¶
- class Nos\Tools_Context¶
Provides static methods to work with yours contexts, sites and languages.
See also
::contexts()¶
- static Nos\Tools_Context::contexts¶
Returns: An array of all your valid contexts. <?php $contexts = \Nos\Tools_Context::contexts(); foreach ($contexts as $context_code => $context_urls) { // .... }
::sites()¶
- static Nos\Tools_Context::sites¶
Returns: An array of all your valid sites. Each site has a title and an alias. <?php $sites = \Nos\Tools_Context::sites(); foreach ($sites as $site_key => $site_params) { $title = $site_params['title']; $alias = $site_params['alias']; }
::locales()¶
- static Nos\Tools_Context::locales¶
Returns: An array of all your valid locales. Each locale has a title and a flag’s code flag. <?php $locales = \Nos\Tools_Context::locales(); foreach ($locales as $locale_key => $locale_params) { $title = $locale_params['title']; $flag = $locale_params['flag']; }
::defaultContext()¶
- static Nos\Tools_Context::defaultContext¶
Returns: The code of default context of your Novius OS instance. <?php $default_context_code = \Nos\Tools_Context::defaultContext();