Download the PHP package xz1mefx/yii2-multilang without Composer
On this page you can find all versions of the php package xz1mefx/yii2-multilang. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-multilang
Multilanguage tools package for yii2
The extension is a package of tools to implement multilanguage in Yii2 project:
- Automatically redirects the user to the URL selected (automatically or manually) language and remembers the user selected language
- Automatically collect all new translates into DB
- Has a widget to set a correct hreflang attributes
- Provides a CRUD actions for edit the list of languages and the interface translations
- Has a widget to create language selector (for adminlte theme)
- Has a
@weblang\
alias with current language
Installation
-
The preferred way to install this extension is through composer, run:
-
Add new multilangCache component to common config file:
-
Execute migration:
or you can create new migration and extend it, example:
-
Override components in common config file:
-
[not necessary] If you use
iiifx-production/yii2-autocomplete-helper
you need to run: -
Override some components in console config file:
-
Add HrefLangs widget to page
<head></head>
section in layout(s): -
Add LanguageController (or another) with next code:
, where you can change action theme (
THEME_BOOTSTRAP
- by default orTHEME_ADMINLTE
) , view path and access to controls in index action.This controller will control system languages.
-
Add TranslationController (or another) with next code:
, where you can change action theme (
THEME_BOOTSTRAP
- by default orTHEME_ADMINLTE
) , view path and access to controls in index action.This controller will control interface translations.
- [not necessary, only for adminlte theme] Add language selector widget into
header ul.nav
:
AdminLTE theme you can found in xz1mefx/yii2-adminlte
package.