随笔分类 -  php

laravel4 「时间戳」问题
摘要:默认 Eloquent 会自动维护数据库表的 created_at 和 updated_at 字段。只要把这两个「时间戳」字段加到数据库表, Eloquent 就会处理剩下的工作。如果不想让 Eloquent 自动维护这些字段,把下面的属性加到模型类里:关闭自动更新时间戳class User ext... 阅读全文

posted @ 2014-11-09 20:56 chenzc 阅读(314) 评论(0) 推荐(0)

laravel运行慢是怎么回事?
摘要:因为默认的 hello 页面引用了 google 的字体,至于为什么 google 这么慢就不用我详细说明了吧。 阅读全文

posted @ 2014-11-08 23:17 chenzc 阅读(482) 评论(0) 推荐(0)

Laravel4快速安装方法,解决Laravel4安装速度慢
摘要:Laravel4原始安装方法Laravel4 是构建在 Composer 之上的, 之前的安装方法是如下:composer create-project laravel/laravel your-project-name --prefer-dist1composer create-project l... 阅读全文

posted @ 2014-11-07 22:58 chenzc 阅读(1246) 评论(0) 推荐(0)

nginx支持.htaccess文件实现伪静态的方法
摘要:方法如下:1. 在需要使用.htaccess文件的目录下新建一个.htaccess文件,vim /var/www/html/.htaccess2. 在里面输入规则,我这里输入Discuz的伪静态规则:# nginx rewrite rulerewrite /!.(js|gif|jpg|png|css... 阅读全文

posted @ 2014-11-07 11:16 chenzc 阅读(802) 评论(0) 推荐(0)

PHP smarty
摘要:assign('name','zhang');//调用模板tpl文件里不能执行PHP语句块$smarty->display('templates/index.tpl');/*index.tpl页面内容你好, {$name}*//*Smarty编译时的处理过程是源php文件->模板文件(可能调用多个或... 阅读全文

posted @ 2014-11-06 16:59 chenzc 阅读(200) 评论(0) 推荐(0)

PHP Warning: strftime(): It is not safe to rely on the system's timezone set
摘要:当运行一些程序时,在httpd日志中会有如下警告日志:PHP Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timez... 阅读全文

posted @ 2014-11-06 16:46 chenzc 阅读(3000) 评论(0) 推荐(1)

导航