it-yakutia/yii2-callback

yii2 的回调

安装: 11

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 0

类型:yii2-extension

v1.0.1 2022-07-04 10:16 UTC

This package is auto-updated.

Last update: 2024-09-04 14:49:19 UTC


README

yii2 服务器的回调表单

安装

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

运行以下命令之一

php composer.phar require --prefer-dist it-yakutia/yii2-callback "*"

或者

"it-yakutia/yii2-callback": "*"

将以下内容添加到您的 composer.json 文件的 require 部分。

在控制台配置文件中添加迁移路径

'controllerMap' => [
    ...
    'migrate' => [
    ...
        'migrationPath' => [
            ...
            '@vendor/it-yakutia/yii2-callback/src/migrations',
        ],
    ],
]

使用方法

扩展安装后,只需在您的代码中通过以下方式使用它

<?= Url::toRoute(['/callback/back/index']); ?>

添加 RBAC 角色

callback

对于前端使用视图参数模板

<?php
return [
    // ...
    'custom_view_for_modules' => [
        // ...
        'callback_front' => [
            'create' => '@frontend/themes/basic/views/callback/create',
            '_form' => '@frontend/themes/basic/views/callback/_form',
            'thanks' => '@frontend/themes/basic/views/callback/thanks'
        ]
    ],
];

并添加链接

<?= Url::toRoute(['/callback/front/create']); ?>