文章分类 -  yii2

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