Esempio n. 1
0
 /**
  * Translates a message. This is just a wrapper of Yii::t
  *
  * @see Yii::t
  *
  * @param $category
  * @param $message
  * @param array $params
  * @param null $language
  * @return string
  */
 public static function t($category, $message, $params = [], $language = null)
 {
     if (!isset(Yii::$app->i18n->translations['simplator/' . $category])) {
         Module::registerTranslations($category);
     }
     return Yii::t('simplator/' . $category, $message, $params, $language);
 }
Esempio n. 2
0
 /**
  * Init module
  */
 public function init()
 {
     if (\Yii::$app instanceof \yii\console\Application) {
         $this->controllerNamespace = 'simplator\\settings\\commands';
     }
     parent::init();
 }
Esempio n. 3
0
 public function init()
 {
     parent::init();
     if (!$this->_storage) {
         die('Need set storage for medialib');
     }
     $this->setMimetypes(['file' => ['*/*', 'asd/*']]);
     if (!isset($this->models['folder'])) {
         $this->models['folder'] = 'simplator\\medialib\\models\\Folder';
     }
     models\Entity::$models = $this->models;
     // custom initialization code goes here
 }
Esempio n. 4
0
 public function init()
 {
     if (\Yii::$app instanceof \yii\console\Application) {
         $this->controllerNamespace = 'simplator\\articles\\commands';
     }
     parent::init();
     if (!count($this->_plugins)) {
         $this->setPlugins([]);
     }
     if (!strlen($this->title)) {
         $this->title = Module::t('articles', 'Articles');
     }
     //articlesAsset::register($view)->addLanguage($this->language, 'fileinput_locale_');
     $this->breadcrumbs = [];
     // custom initialization code goes here
 }
Esempio n. 5
0
 /**
  * Init module
  */
 public function init()
 {
     parent::init();
 }