文章分类 - yii2
摘要:就是不使用 use 加载 eg: $test = 'News';$aa = 'Wechat'.$test.'Reply';$modelName = "\\backend\\models\\wechat\\{$aa}";$newsReply = $modelName::findOne(['rid'=>
阅读全文
摘要:z转:https://blog.csdn.net/wuhuagu_wuhuaguo/article/details/80222774
阅读全文
摘要:1.$page = yii::$app->request->get('page',1);默认第一页 2.调用接口,确定总数据,$res['total']] 3.yii2自带分页后端: $dataProvider = new ArrayDataProvider([ 'allModels' => $re
阅读全文
摘要:Yii2 获取模块名、控制器名、方法名在视图中: 模块名块名名$this->context->module->id 控制器名器名名$this->context->id 方法名法名名$this->context->action->id 在控制器中 模块名块名名Yii::$app->controller
阅读全文
该文被密码保护。
摘要:转:文档:https://www.yiichina.com/doc/guide/2.0/tutorial-i18n 转:https://www.cnblogs.com/jianqingwang/p/6373168.html
阅读全文
摘要:我们的数据库常常都是很庞大的,一次查询的结果集也很大,这样很浪费内存,为了降低内存的使用率,我们可以使用yii2的batch和each方法。 为了让大家看的更明白,我们模拟一个场景,然后通过yii2的debug来查看all与batch/each方法下的内存使用情况。 开始准备 我们先建立一张表,它很
阅读全文
摘要:转:https://www.cnblogs.com/wangjiafang/p/4583949.html
阅读全文
摘要:转:https://cloud.tencent.com/developer/article/1467461
阅读全文
摘要:Yii::$app->db->schema->refresh();
阅读全文
摘要:<?= $form->field($model, 'fragment_id')->dropDownList(['0'=>'未选择类型']+yii\helpers\ArrayHelper::map($gachaFragmentModel,'id','name'))?> <?= $form->field
阅读全文
摘要:现有 group (组)和 user (用户) 两种实例。 一个 group 中可以拥有多个 user,一个 user 也可以属于有多个 group (多对多关系) GroupUserRelation 表用于绑定组合组员的关系(使用id绑定)字段有 id, group_id, user_id 现有U
阅读全文
摘要:转:https://segmentfault.com/a/1190000003765846 https://blog.csdn.net/u012979009/article/details/51752693
阅读全文
摘要:<?phpuse yii\widgets\Breadcrumbs;/* @var $this yii\web\View */$this->title = '宝箱详情: '.$model->id;$this->params['breadcrumbs'][] = ['label' => '宝箱类型',
阅读全文
摘要:现在在 post表里面有 title ,image ,content 三个的字段,当我创建一个 post 的时候,我想三个字段全部是必填项,但是你修改的时候,title content 两个字段是必填的, image可以不填写。正常的情况下,[[‘title’, ‘content’, ‘image’
阅读全文
摘要://查询出每个用户个数,等于,是first和last个数的数据 SELECT customer.id, customer.name, customer.level, record.total, customer.customer_id, customer.nick FROM ( SELECT COU
阅读全文
摘要:转:https://blog.csdn.net/qq_31659985/article/details/82625994
阅读全文

浙公网安备 33010602011771号