摘要: 不跳转代码:return $this->redirect('http://www.yiichina.com/'); 跳转代码:return $this->redirect('http://www.yiichina.com/')->send(); 或者: $this->redirect('http:/ 阅读全文
posted @ 2017-05-31 10:27 pengcx 阅读(3184) 评论(0) 推荐(1) 编辑
摘要: 1、样式和脚本 1.1 Yii 提供两个方法用于生成包含内联样式和脚本代码的标签。 阅读全文
posted @ 2017-05-27 17:54 pengcx 阅读(765) 评论(0) 推荐(0) 编辑
摘要: $transaction = Yii::$app->db->beginTransaction(); try{ //删除$model中的数据 $res = $model->deleteAll($cond); if(!$res) throw new \Exception('操作失败!'); //删除$m 阅读全文
posted @ 2017-05-25 16:54 pengcx 阅读(561) 评论(0) 推荐(0) 编辑
摘要: // WHERE name = 'dogstar' AND age = 18 $user->where(array('name' => 'dogstar', 'age' => 18)) // WHERE name = 'dogstar' OR age = 18 $user->or('name', ' 阅读全文
posted @ 2017-05-22 08:49 pengcx 阅读(2821) 评论(0) 推荐(0) 编辑
摘要: 1、http://tech.anruence.com/ 2、http://www.yiichina.com/doc/guide/2.0/input-multiple-models 阅读全文
posted @ 2017-05-19 13:11 pengcx 阅读(123) 评论(0) 推荐(0) 编辑
摘要: <?php $form = ActiveForm::begin([ 'options'=>['class' => 'form-horizontal row-border','enctype'=>"multipart/form-data"], 'fieldConfig'=>[ 'options'=>[ 阅读全文
posted @ 2017-05-18 15:58 pengcx 阅读(703) 评论(0) 推荐(0) 编辑
摘要: https://github.com/FriendsOfPHP/Goutte 阅读全文
posted @ 2017-05-12 18:04 pengcx 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1、在 model 里面定义一下场景 类名必须是 scenarios() 2、下面我们设置 rules() ,调用场景我们用 on 关键字 3、model 里面我们就设置完毕了 现在开始调用吧。 Controller 里面 阅读全文
posted @ 2017-05-12 17:57 pengcx 阅读(821) 评论(0) 推荐(0) 编辑
摘要: http://www.yii-china.com/doc/yii2-windows.html?id=278 阅读全文
posted @ 2017-05-12 15:35 pengcx 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 下面就是打开的命令窗口,如果我们要修改成UTF8编码,输入命令 CHCP 65001 下面就是打开的命令窗口,如果我们要修改成UTF8编码,输入命令 CHCP 65001 阅读全文
posted @ 2017-05-09 10:06 pengcx 阅读(262) 评论(0) 推荐(0) 编辑