随笔分类 -  Yii

摘要:php导出excel号码过长会后面会自动变成0000 数据表格导出数据到excel后,数字如果过长,比如身份证号,会变成科学计数方式, 解决方法: 在你要导出的表格标签加上style='vnd.ms-excel.numberformat:@' ; 导出的数据在excel里面看就会显示文本了,默认是常 阅读全文
posted @ 2020-06-04 14:33 JahanGu 阅读(237) 评论(0) 推荐(0)
摘要:入口文件index.js开始 通过Application创建app, 并且读入config, 装载扩展和组件 通过request解析被请求的路由app根据路由创建controllercontroller创建action如果过滤器通过, 则会执行actionaction会渲染视图viewview中的内 阅读全文
posted @ 2020-05-21 20:18 JahanGu 阅读(555) 评论(0) 推荐(0)
摘要:原因:linux下面默认的Gii只能通过127.0.0.1来访问,也就是本机访问,安全; 解决:在conf/main-local.php添加自己的ip 阅读全文
posted @ 2018-04-08 20:33 JahanGu 阅读(443) 评论(0) 推荐(0)
摘要:来一段百度来的正常解决方法,注意有很大的坑! 第一种解决办法是关闭Csrf 1配置文件关闭 2控制器里面关闭 第二种解决办法是在form表单中加入隐藏域 第三种解决办法是在AJAX中加入_csrf字段 我用ajax提交的,又不想关闭csrf验证(不推荐),所以选择第三种解决方法,在data中添加 参 阅读全文
posted @ 2018-03-02 13:31 JahanGu 阅读(264) 评论(0) 推荐(0)
摘要:FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot use 'Object' as class name as it is reserved in /home/leo/htdocs/oa/vendor/yiisoft/yii2/ 阅读全文
posted @ 2018-01-02 13:02 JahanGu 阅读(2286) 评论(0) 推荐(0)
摘要:1.下载地址:https://github.com/PHPOffice/PHPExcel 2.解压并修改文件名为phpexcel 之后在yii项目的vendor目录下创建一个文件夹命名为phpoffice 把phpexcel文件放到phpoffic文件夹下 此时查看vendor\phpoffice\ 阅读全文
posted @ 2017-12-14 17:56 JahanGu 阅读(3255) 评论(0) 推荐(0)
摘要:1、首先从官网下载yii2-imagine的拓展 下载地址:https://github.com/yiisoft/yii2-imagine 下载包名称:yii2-imagine-master 2、然后再下载imagine的插件包 下载地址:https://github.com/avalanche12 阅读全文
posted @ 2017-12-14 17:06 JahanGu 阅读(1425) 评论(0) 推荐(0)
摘要:通过 Composer 安装 如果还没有安装 Composer,在 Linux 和 Mac OS X 中可以运行如下命令: curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/compose 阅读全文
posted @ 2017-09-06 11:15 JahanGu 阅读(261) 评论(0) 推荐(0)
摘要:1:在控制器内成员变量设置 public $layout = false; //不使用布局 public $layout = “main”; //设置使用的布局文件 2:在控制器成员方法内设置 $this->layout = false; //不使用布局 $this->layout = “main” 阅读全文
posted @ 2017-09-06 11:13 JahanGu 阅读(235) 评论(0) 推荐(0)