摘要: ThinkPHP内置函数详解D、F、S、C、L、A、I单字母函数D、F、S、C、L、A、I 他们都在ThinkPHP核心的ThinkPHP/Mode/Api/functions.php这个文件中定义.下面我分别说明一下他们的功能:D() 加载Model类M() 加载Model类A() 加载Actio... 阅读全文
posted @ 2014-11-19 20:12 流白荒芜了我的时光 阅读(302) 评论(0) 推荐(0)
摘要: ThinkPHP中的BUG及技巧与策: 1. 模板中不能使用的标签 {$content} {$i} 2. If标签 如: 试验后总是有想不到的错误, 这样,还不如直接用php if(…){ …?>来得块些呢.约定: 1.所有类库文件必须使用.class.php作为文件后缀,并且类名和文件名保持一致 ... 阅读全文
posted @ 2014-11-18 20:23 流白荒芜了我的时光 阅读(182) 评论(0) 推荐(0)
摘要: show(' :)欢迎使用 ThinkPHP!','utf-8'); $this->display();}function addinfo(){ $M=M("admin"); $data=$_POST; $data['in_date']=time(); $q=$M->add($data); echo... 阅读全文
posted @ 2014-11-17 19:13 流白荒芜了我的时光 阅读(148) 评论(0) 推荐(0)
摘要: path=$path;$this->files=$files;$this->seterror=1;$this->allowtype=array("jpg","gif","JPG","png");$this->filetype=array();$this->filenewname=array();if... 阅读全文
posted @ 2014-11-14 19:20 流白荒芜了我的时光 阅读(162) 评论(0) 推荐(0)
摘要: filename=$files['name']; $types=explode(".",$this->filename); $this->filetype=$types[count($types)-1]; $this->filesize=$files['size']; $this->fileerro... 阅读全文
posted @ 2014-11-13 19:51 流白荒芜了我的时光 阅读(97) 评论(0) 推荐(0)
摘要: table=$table; $this->pagesize=$pagesize; $sql="select * from ".$table.""; $query=mysql_query($sql); $this->page=isset($_GET['page'])?$_GET['page']:1; ... 阅读全文
posted @ 2014-11-12 19:12 流白荒芜了我的时光 阅读(143) 评论(0) 推荐(0)
摘要: (1)final: 1,final不能修饰成员属性 2,final只能修饰类和方法作用: 使用final修饰的类不能被子类继承 使用final修饰的方法不能被子类去覆盖 用来限制类不被继承,方法不能被覆盖就使用final (2、)static: 1,使用static可以修饰成员属性和成员方法,不能修... 阅读全文
posted @ 2014-11-11 19:34 流白荒芜了我的时光 阅读(415) 评论(0) 推荐(0)
摘要: 1、传递任意数量的函数参数 我们在.NET或者JAVA编程中,一般函数参数个数都是固定的,但是PHP允许你使用任意个数的参数。下面这个示例向你展示了PHP函数的默认参数:?12345678910111213141516171819// 两个默认参数的函数function foo($arg1 = ”... 阅读全文
posted @ 2014-11-10 20:42 流白荒芜了我的时光 阅读(127) 评论(0) 推荐(0)
摘要: Smarty的缓存机制 1.Smarty的缓存机制默认是不开启的,需要开发人员自己开启;Smarty编译默认是开启的 2.缓存是一种思想,不要刻意使用,缓存机制的根本原理是:通过空间换时间 3.清除缓存的方法 ①$smarty->clear_all_cache() ②$smarty... 阅读全文
posted @ 2014-11-09 19:40 流白荒芜了我的时光 阅读(141) 评论(0) 推荐(0)
摘要: //载入核心文件include "./libs/Smarty.class.php";$smarty = new Smarty();//模版目录$smarty->template_dir = "template";//模版目录$smarty->compile_dir = "temp/compile";... 阅读全文
posted @ 2014-11-09 19:36 流白荒芜了我的时光 阅读(126) 评论(0) 推荐(0)