| Current Path : /var/www/html/dosmv2/backend/modules/repodl/ |
| Current File : /var/www/html/dosmv2/backend/modules/repodl/Module.php |
<?php
namespace backend\modules\repodl;
use Yii;
/**
* Class Module Manager
*/
class Module extends \yii\base\Module
{
/**
* Base url for repository
* @var string
*/
public $baseUrl;
/**
* Module root directory
* @var string
*/
private $root = 'repodl'; // change this to the correct module folder name
/**
* @var string
*/
public $controllerNamespace = 'backend\modules\repodl\controllers';
/**
* init
*/
public function init()
{
parent::init();
$this->registerTranslations();
}
/**
* register the translation
*/
public function registerTranslations()
{
Yii::$app->i18n->translations['modules/repodl/*'] = [
'class' => 'yii\i18n\PhpMessageSource',
'sourceLanguage' => 'en-US',
'basePath' => '@app/modules/' .$this->root. '/messages', // change this to your module directory
'fileMap' => [
'modules/' .$this->root. '/common' => 'common.php',
],
];
}
public static function t($category, $message, $params = [], $language = null)
{
return Yii::t('modules/repodl/' . $category, $message, $params, $language);
}
}