Class lajax\translatemanager\models\ImportForm

Inheritancelajax\translatemanager\models\ImportForm » yii\base\Model
Available since version1.5.0

Import Form.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$importFile \yii\web\UploadedFile The file to import (json or xml) lajax\translatemanager\models\ImportForm

Public Methods

Hide inherited methods

MethodDescriptionDefined By
import() Import the uploaded file. Existing languages and translations will be updated, new ones will be created. lajax\translatemanager\models\ImportForm
rules() lajax\translatemanager\models\ImportForm

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
parseImportFile() Parse the uploaded file (xml or json) and return it as an array lajax\translatemanager\models\ImportForm
throwInvalidModelException() Converts the model validation errors to a readable format an throws it as an exception lajax\translatemanager\models\ImportForm

Property Details

$importFile public property

The file to import (json or xml)

public \yii\web\UploadedFile $importFile null

Method Details

import() public method

Import the uploaded file. Existing languages and translations will be updated, new ones will be created.

Source messages won't be updated, only created if they not exist.

public array import ( )
throws \yii\web\BadRequestHttpException
throws \yii\base\Exception
parseImportFile() protected method

Parse the uploaded file (xml or json) and return it as an array

protected Array parseImportFile ( )
throws \yii\web\BadRequestHttpException
rules() public method

public void rules ( )
throwInvalidModelException() protected method

Converts the model validation errors to a readable format an throws it as an exception

protected void throwInvalidModelException ( $model )
$model \yii\db\ActiveRecord
throws \yii\base\Exception