oteixido/yii2-bank-module

Yii2 Bank 模块

安装次数: 169

依赖者: 1

建议者: 0

安全: 0

星标: 0

分支: 0

类型:yii2-extension

2.6.0 2020-01-22 06:06 UTC

README

Yii2 Bank 模块

安装

安装此扩展的首选方式是通过 composer

可以运行

php composer.phar require --prefer-dist oteixido/yii2-bank-module "*"

或添加

"oteixido/yii2-bank-module": "*"

到您的 composer.json 文件的 require 部分中。

配置

'modules' => [
    ...
    'gridview' => [
        'class' => 'kartik\grid\Module',
    ],    
    'bank' => [
        'class' => 'oteixido\bank\Module',
        'params' => [
            'invoices.upload.path' => '/uploads/invoices'
        ],
        'components' => [
            'importer' => [
                /*
                 * Example of CSV file
                 * 2018-05-01;-600,95;Transferencia recibida;CE;Transferencia
                 */
                'class' => 'oteixido\importer\ImporterCSV',
                'classname' => 'oteixido\bank\models\Transaction',
                'attributes' => [
                    [
                        'attribute' => 'date'
                    ],
                    [
                        'attribute' => 'value',
                        'filters' => [
                            '/\./' => '',
                            '/,/' => '.',
                        ],
                    ],
                    [
                        'attribute' => 'description',
                    ],
                    [
                        'attribute' => 'account_id',
                        'foreignClassname' => 'oteixido\bank\models\Account',
                        'foreignAttribute' => 'name',
                        'foreignKey' => 'id',
                    ],
                ],
            ],
        ],
    ],
    ...
]

迁移

./yii migrate --migrationPath=vendor/oteixido/yii2-bank-module/migrations/