yii2_vue_表单案例
Posted 木子炜培先生
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了yii2_vue_表单案例相关的知识,希望对你有一定的参考价值。
<?php /** * Created by PhpStorm. * User: Administrator * Date: 2017/2/5 * Time: 17:36 */ use yii\helpers\Url; use \common\models\AdminSite; use \common\utils\Cache; use \common\services\TudouService; $adminsite=Cache::GAutoRoute(‘adminsite‘,TudouService::class,‘getAdminSite‘,60); $keywords=Cache::GAutoRoute(‘keywords‘,TudouService::class,‘getKeywords‘,0,60); $channel=Cache::GAutoRoute(‘channel‘,TudouService::class,‘getChannel‘,0,60);
//$channel代表AR
?> <div class="container"> <form id="demo" method="post" class="form " action="<?=Url::toRoute(‘admin-npsearch/test‘)?>"> <div class="row"> <div class="col-md-4"> <label class="span6">分类ID-:</label> <select class="form-group span6" name="FTypeID" v-model="FTypeID"> <option v-for="(item,key) in admin_channel.options" :value="item.fid">{{item.name}}</option> </select> {{FTypeID}} </div> </div> <input class="btn btn-success btn-block" type="submit"> </form> </div> <script> new Vue({ el: ‘#demo‘, data: { keyword: ‘‘, FTypeID: ‘1‘, FSiteID: ‘1‘, FKeywordID:‘1‘, site: { options:<?=$adminsite?> }, keywords: { options:<?=$keywords?> }, admin_channel: { options:<?=$channel?> }, } }); </script>
以上是关于yii2_vue_表单案例的主要内容,如果未能解决你的问题,请参考以下文章
SQL Server 表的管理_关于数据增删查改的操作的详解(案例代码)
SpringBoot中表单提交报错“Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported“(代码片段
Express实战 - 应用案例- realworld-API - 路由设计 - mongoose - 数据验证 - 密码加密 - 登录接口 - 身份认证 - token - 增删改查API(代码片段