BUG描述:登录直接显示 原因:服务器设置端口权限,或者DNS毛病 解决方案:只能去服务器端设置,配置端口 DNS: 修改dns 114.114.114.114 或者 8.8.8.8 ...
分类:
Web程序 时间:
2017-01-12 23:14:06
阅读次数:
558
BUG描述:$ is not defined 没有加载jquery成功 原因:Yii2.0将JS代码默认加载页面加载后 解决方案: 第一种方案:最简单方法是在 assets\AppAsset.php 中加上,页面前加载 第二种方案:But in production you usually want ...
分类:
其他好文 时间:
2017-01-12 23:06:07
阅读次数:
267
文本框:textInput(); 密码框:passwordInput(); 单选框:radio(),radioList(); 复选框:checkbox(),checkboxList(); 下拉框:dropDownList(); 隐藏域:hiddenInput(); 文本域:textarea(['ro... ...
分类:
Web程序 时间:
2017-01-10 13:39:55
阅读次数:
207
查看 \yii\i18n\I18N::translate()方法: 其中 $messageSource = $this->getMessageSource($category);//根据配置文件内容和 给的参数$category 返回继承MessageSource 相应子类的实例对象, 本例根据配置 ...
分类:
其他好文 时间:
2017-01-08 20:07:06
阅读次数:
188
我们假设全局性的公共类文件位于common/components/Helper.php,其内容如下: 1 2 3 4 5 6 7 8 9 <?php namespace common\components; class Helper { public function checkedMobile ( ...
分类:
其他好文 时间:
2017-01-08 09:59:13
阅读次数:
223
先将官网下载的压缩包解压,将advanced文件夹在网站根目录中 2.右键“我的电脑”-> 属性 ->高级系统设置,将php.exe所在目录(c:\xampp\php)以及c:\xampp\php\ext目录的路径加入到path中 3.运行advanced下init.bat程序,执行init或在安装 ...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public function actionContact() { $model = new ContactForm(); if ($model->load(Yii::$app->request->post()) && $ ...
分类:
其他好文 时间:
2017-01-08 09:10:34
阅读次数:
358
有两个例子:刷新时间和数据显示排序 1、刷新时间 (1)控制器中的方法:Time 1 2 3 4 public function actionTime() { return $this->render('time',['time'=>date("h:i:s")]); } 1 2 3 4 public ...
分类:
其他好文 时间:
2017-01-08 09:09:08
阅读次数:
171
cmd命令窗,先切换到advanced目录下(即有composer.json的文件夹下) composer update yiisoft/yii2 yiisoft/yii2-composer bower-asset/jquery.inputmask composer require dmstr/yi ...
一、ActiveRecord 活动记录 1.with关联查询 例如,查询评论 等价于以下结果集 2.joinWith关联查询,返回 等价于: ...
分类:
数据库 时间:
2017-01-06 22:01:59
阅读次数:
490