meliorator / yii2-helpers
Yii-Framework small helpers
Package info
github.com/meliorator/yii2-helpers
Type:yii2-extension
pkg:composer/meliorator/yii2-helpers
dev-master
2019-06-26 00:39 UTC
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2026-03-17 11:49:36 UTC
README
#My small helper classes for yii2 for using migration class template, need added this code
'controllerMap' => [ 'migrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'templateFile' => '@app/vendor/meliorator/yii2-helpers/migration_template.php', ], ],
####for use localization site
- add to config/web.php components section follow code
'i18n' => [ 'translations' => [ 'app*' => [ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@app/messages', 'sourceLanguage' => 'en-US', 'fileMap' => [ 'app' => 'app.php', // 'app/error' => 'error.php', ], ], ], ],
- add support languages to params
'langs' => [ 'en' => 'English', 'ua' => 'Українська', 'ru' => 'Русский' ], 'defaultLangId' => 'en',
- attach behavior LocalizeBehavior to Controller
public function behaviors() { return ArrayHelper::merge(parent::behaviors(), [ 'localizeBehavior' => LocalizeBehavior::className(), ] ); }