geniv / nette-locale-switch
Locale switch component for Nette Framework
Installs: 1 059
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- geniv/nette-general-form: >=1.0
- geniv/nette-locale: >=2.0
- nette/nette: >=2.4
README
Installation
$ composer require geniv/nette-locale-switch
or
"geniv/nette-locale-switch": "^2.0"
require:
"php": ">=7.0", "nette/nette": ">=2.4", "geniv/nette-locale": ">=2.0", "geniv/nette-general-form": ">=1.0"
neon configure:
services: - LocaleSwitch
usage:
protected function createComponentLocaleSwitch(ILocaleSwitch $localeSwitch, IAliasRouter $aliasRouter): ILocaleSwitch { //$localeSwitch->setTemplatePath(__DIR__ . '/templates/header-lang.latte'); $domain = $aliasRouter->getDomainAlias(); if ($domain) { $localeSwitch->setDomain($domain); } return $localeSwitch; }
usage:
{control localeSwitch} or {control localeSwitch, $idLocale}