Class lajax\translatemanager\behaviors\TranslateBehavior

Inheritancelajax\translatemanager\behaviors\TranslateBehavior » yii\behaviors\AttributeBehavior
Available since version1.5.3

TranslateManager Database translate behavior.

Installation:

[
     'class' => lajax\translatemanager\behaviors\TranslateBehavior::className(),
     'translateAttributes' => ['names of multilingual fields'],
],

or If the category is the database table name.

[
     'class' => lajax\translatemanager\behaviors\TranslateBehavior::className(),
     'translateAttributes' => ['names of multilingual fields'],
     'category' => static::tableName(),
],

Property Details

$category public property

Category of message.

public string $category 'database'
$translateAttributes public property

Method Details

events() public method

public void events ( )
init() public method

public void init ( )
saveAttributes() public method

Saveing new language element by category.

public void saveAttributes ( $event )
$event \yii\base\Event
translateAttributes() public method

Translates a message to the specified language.

public void translateAttributes ( $event )
$event \yii\base\Event