摘要: 使用js的人对闭包是熟悉,以前接触php的时候还不知道可以使用闭包,今天学习了一下,还是记录下来 一个简单的例子 function test_closures(){ $id = 1; $func = function() use ($id){ echo $id; }; //这个结束符一定要加上,今天 阅读全文
posted @ 2016-03-10 22:40 waited 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 用了smarty,tp过后,也想了解了解其模板技术是怎么实现,于是写一个简单的模板类,大致就是读取模板文件->替换模板文件的内容->保存或者静态化 tpl.class.php主要解析 assign 方法实现 /** * 模板赋值操作 * @param mixed $tpl_var 如果是字符串,就作 阅读全文
posted @ 2016-03-09 22:36 waited 阅读(1003) 评论(0) 推荐(1) 编辑
摘要: nginx 软件: a: openssl-1.0.1r.tar.gz tar zxf openssl-1.0.1r.tar.gz b: pcre-8.32.tar.gz tar zxf openssl-1.0.1r.tar.gz cd pcre-8.32 ./configure --prefix=/ 阅读全文
posted @ 2016-03-09 13:37 waited 阅读(405) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtm 阅读全文
posted @ 2016-03-09 00:07 waited 阅读(3805) 评论(0) 推荐(0) 编辑
摘要: 1 class Test_Demo: 2 TEST = 'test_value' 3 4 def __init__(self,name,age): 5 self.name = name 6 self.age = age 7 #static method 8 @staticmethod 9 def t 阅读全文
posted @ 2016-03-08 23:42 waited 阅读(2328) 评论(0) 推荐(1) 编辑