reketaka/yii2-helps
一组有用的辅助函数、小部件和模块
1.232
2022-02-16 07:45 UTC
Requires
- 2amigos/yii2-transliterator-helper: *
- kartik-v/yii2-widget-select2: @dev
- kotchuprik/yii2-sortable-widgets: *
- npm-asset/bootstrap-notify: *
- unclead/yii2-multiple-input: *
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-httpclient: ^2.0
- dev-master
- 1.232
- 1.231
- 1.230
- 1.229
- 1.228
- 1.227
- 1.226
- 1.225
- 1.224
- 1.223
- 1.222
- 1.221
- 1.220
- 1.219
- 1.218
- 1.217
- 1.216
- 1.215
- 1.214
- 1.213
- 1.212
- 1.211
- 1.210
- 1.209
- 1.208
- 1.207
- 1.206
- 1.205
- 1.204
- 1.203
- 1.202
- 1.201
- 1.200
- 1.199
- 1.198
- 1.197
- 1.196
- 1.195
- 1.194
- 1.193
- 1.192
- 1.191
- 1.190
- 1.189
- 1.188
- 1.187
- 1.186
- 1.185
- 1.184
- 1.183
- 1.182
- 1.181
- 1.180
- 1.179
- 1.178
- 1.177
- 1.176
- 1.175
- 1.174
- 1.173
- 1.172
- 1.171
- 1.170
- 1.169
- 1.168
- 1.167
- 1.166
- 1.165
- 1.164
- 1.163
- 1.162
- 1.161
- 1.160
- 1.159
- 1.158
- 1.157
- 1.156
- 1.155
- 1.154
- 1.153
- 1.152
- 1.151
- 1.150
- 1.149
- 1.148
- 1.147
- 1.146
- 1.145
- 1.144
- 1.143
- 1.142
- 1.141
- 1.140
- 1.139
- 1.138
- 1.137
- 1.136
- 1.135
- 1.134
- 1.133
- 1.132
- 1.131
- 1.130
- 1.129
- 1.128
- 1.127
- 1.126
- 1.125
- 1.124
- 1.123
- 1.122
- 1.121
- 1.120
- 1.119
- 1.118
- 1.117
- 1.116
- 1.115
- 1.114
- 1.113
- 1.112
- 1.111
- 1.110
- 1.109
- 1.108
- 1.107
- 1.106
- 1.105
- 1.104
- 1.103
- 1.102
- 1.101
- 1.009
- 1.008
- 1.007
- 1.006
- 1.005
- 1.004
- 1.003
- 1.002
- 1.000
- dev-branch_18
- dev-list_of_payment_system_merge_master
This package is auto-updated.
Last update: 2024-09-16 13:24:03 UTC
README
一组有用的辅助函数、小部件和模块 需要安装 asset-packagist.org
安装
安装此扩展的首选方式是通过composer。
运行以下命令之一
php composer.phar require --prefer-dist reketaka/yii2-helps "*"
或添加
"reketaka/yii2-helps": "*"
到你的composer.json文件的require部分。
用法
安装迁移控制器,如果没有指定表创建选项,则设置CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB
'migrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'templateFile' => '@reketaka/helps/common/views/migration/migration.php', 'generatorTemplateFiles' => [ 'create_table'=>'@reketaka/helps/common/views/migration/createTableMigration.php' ] ]
Regedit模型
console config.php
'controllerMap' => [
'regedit'=>[
'class'=>'reketaka\helps\common\commands\RegeditController'
]
],
config.php
'components' => [
'regedit'=>[
'class'=>'reketaka\helps\common\models\Regedit'
],
'db'=>[
'schemaMap' => [
'mysql'=>'reketaka\helps\common\models\db\mysql\Schema'
]
]
]
使用
Yii::$app->regedit->get('//modules/myModule/someVar');
Yii::$app->regedit->remove('//modules/myModule/someVar');
Yii::$app->regedit->clearCache();
Yii::$app->regedit->getList('//modules/myModule/someVar');
Yii::$app->regedit->set('//modules/myModule/someVar', 'test');
与1c交换数据的模块
为了安装从1c接收数据的模块,该模块会自动接收并保存数据,可能以zip格式接收数据
所有接收到的文件都存储在$module->getProgressDirPath()中,在处理完毕后,您可以将其复制到$module->getBackupDirPath()文件夹
在1c中调用
http://dev_price.sunrise22.ru/importOnec/import-onec/auto
'modules'=>[
'importOnec'=>[
'class'=>'reketaka\helps\modules\onec\Module',
'userName'=>'test';
'userPassword'=>'test';
'authKeyName'=>'AuthKey';
'authKeyVal'=>'pzshkmm0VzIZru65cB1Zsr6o47xZYqpR';
'maxFileSize'=>102400;
'enableZip'=>true;
'saveDirPath'=>'@backend/runtime/temp';
'authKeyCallback' => function(){
if (!($cookie = Yii::$app->request->headers->get('cookie', false))) {
throw new Exception('Not find authKey in Cookie');
}
list($n, $authKey) = explode('=', $cookie);
return $authKey;
}
]
]