Download the PHP package devgroup/yii2-multilingual without Composer
On this page you can find all versions of the php package devgroup/yii2-multilingual. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devgroup/yii2-multilingual
More information about devgroup/yii2-multilingual
Files in devgroup/yii2-multilingual
Package yii2-multilingual
Short Description Allows building yii2 apps for multiple languages using regional URL's and domains
License MIT
Homepage http://www.devgroup.ru/
Informations about the package yii2-multilingual
Yii2 multilingual component
Allows building yii2 apps for multiple languages using regional URL's and domains
Quick start:
WARNING: This extension is under active development.
For support - join DotPlant2 gitter channel.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Configure your application
In your web.php
config add the following components:
Creating translatable ActiveRecord
As our implementation is based on creocoder/yii2-translatable
- the use creation of multilingual ActiveRecords is very similar.
The main differences from creocoder2/yii2translatable
:
- no need to set
translationAttributes
- they automatically detected from translation model - language field is
language_id
of integer type
In your ActiveRecord class(for example Post
) add trait and behavior:
HrefLang
Add one line into your HEAD section of layout view:
Tips
- Remember to take care of language_id when caching multilingual or translatable content
- In requests to excluded routes there may be no
language_id
, but probably can becookie_language_id
- If you want to generate URL's from console application you may need to configure additional params(see https://github.com/DevGroup-ru/yii2-multilingual-demo/blob/master/config/console.php)
- MultilingualTrait adds default conditions to find and is not required for use. But if you don't use it - you must manually configure proper relations.
- Add indexes to your translation tables, especially for
language_id
andmodel_id
pair.
Credits and inspiration sources
- Michael Härtl - author of codemix/yii2-localeurls
- Company BINOVATOR - authors of SypexGeo database and php class
- Alexander Kochetov (@creocoder) - yii2-translatable package
All versions of yii2-multilingual with dependencies
yii2tech/filedb Version ^1.0@dev
devgroup/yii2-tag-dependency-helper Version ~1.4.0
kartik-v/yii2-icons Version ~1.4.0