PHP Yii2.0框架 注册码(激活码)功能
PHP Yii2.0框架 注册码(激活码)功能
1 视图部分
1、激活码列表
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\LinkPager;/* @var $this yii\web\View */
/* @var $searchModel frontend\modules\resource\models\BranchSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */$this->title = '激活码列表';
?><!--新增按钮--><div class="addBtn">= Html::a('导出激活码', '/resource/branch/export/?brid='.$brid, ['class' => 'btn btn-success create']) ?></div>
<div class="branch-form">= GridView::widget(['dataProvider' => $dataProvider,'columns' => ['code',['label' => '企业名称',//通过关联模型来获取其他表的数据'value' =>'branch.title' ],['label' => '用户姓名','value' =>'member.user_name' ],['label' => '用户手机号','value' => 'member.phone' ],'act_time',],'pager' => ['class' => LinkPager::className(),'firstPageLabel' => '首页','prevPageLabel' => '<','nextPageLabel' => '>','lastPageLabel' => '尾页','maxButtonCount' => 5,'hideOnSinglePage' => false,]]); ?></div>
<script src="/js/jquery-1.10.2.min_65682a2.js"></script>
效果展示:

2、生成激活码页面
create部分
use yii\helpers\Html;$this->title = '生成激活码';
?>
<div class="branch-create">= $this->render('act_form', ['branch'=>$branch]) ?></div>
act_form 部分:
<div class="branch-form"><form action="'resource/branch/activationcreateok']); ?>" method="post"><input name="_csrf-frontend" type="hidden" id="_csrf" value="= Yii::$app->request->csrfToken ?>"><input name="brid" type="hidden" id="brid" value="= Html::encode($branch->id) ?>"><label class="control-label">企业名称:label><input type
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
