it-yakutia / yii2-callback
yii2 的回调
v1.0.1
2022-07-04 10:16 UTC
Requires
- uraankhayayaal/yii2-materializecomponents: ~1.0.1
- yiisoft/yii2: ~2.0.0
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']); ?>