共26页: 首页 上一页 7 8 9 10 11 12 13 14 15 下一页 末页 
摘要: As we know, when using netbeans, it will scan the project automaticly by itself, at this time, it will slow down the system. Also, when adding a file to the project folder (not via NetBeans but you do it in the folder), you have to close NetBeans to refresh the project files for the reason that you 阅读全文
posted @ 2012-02-12 18:28 DavidHHuan 阅读(225) 评论(0) 编辑
摘要: 这里作个记录平时使用的经验:/*************************************假设正确的返回值格式为:{"state":1,"msg":"return_message"}*************************************/$.ajax({'type':'POST','dataType':'json',//注意这里使用了json'url':'http://www.test.com/','阅读全文
posted @ 2012-02-10 15:23 DavidHHuan 阅读(500) 评论(0) 编辑
摘要: 个人觉得,在 Yii 里面,最难以明白的就是事件(Event)和行为(behavior)了。这不仅仅是因为它们的概念比较难明,关键是它们的应用场景比较难明,不知道什么时候应该使用事件和行为来开发。关于 Yii 的事件和行为的描述,可参考 http://www.yiiframework.com/doc/api/1.1/CComponent本文参考的文章:http://yiibook.yiiblogs.com/?p=584http://www.larryullman.com/2010/07/20/forcing-login-for-all-pages-in-yii/http://www.yiifr阅读全文
posted @ 2012-01-19 09:35 DavidHHuan 阅读(2716) 评论(0) 编辑
摘要: 这是我见过对 Yii Framework 的 CComponent 写得比较好的文章,原文地址:http://www.yiiframework.com/forum/index.php?/topic/17072-ccomponent%E5%9F%BA%E7%A1%80%E7%B1%BB/CComponentCComponent类为YII框架的基于组件和事件驱动编程提供了基础,YII框架中的大部分类都将CComponent类作为基类。CComponent类为它的子类提供3个特性:1、成员变量扩展通过定义两个成员函数(getXXX/setXXX)来定义一个成员变量,比如:public functio阅读全文
posted @ 2012-01-17 23:32 DavidHHuan 阅读(308) 评论(0) 编辑
摘要: Let say you installed PHP and run it for a month, but now you want to use curl in PHP.But so bad that you didn't install this extension when you installed PHP. That is to say, now you want to add PHP extension. Here is an example to install curl extension.apache2 is in/usr/local/apache2php is in阅读全文
posted @ 2012-01-09 15:53 DavidHHuan 阅读(446) 评论(0) 编辑
摘要: Here is an example of how to develop a widget (yes, widget is also an extension in Yii) in Yii.Let say you want to display something with widget in the page, of course you can place your widget in protected/componentswhen there are one or two classes inside. But when there is a lot of them,it is har阅读全文
posted @ 2012-01-09 10:37 DavidHHuan 阅读(371) 评论(0) 编辑
摘要: Here we will use CLinkPager for example.when using CLinkPager widget, we always follow this way: <?$this->widget(‘CLinkPager’,array('pages'=>$pages,'pageSize'=>15,))?>Here we set it to display 15 items per page. But if we have many action view page with CLinkPager, we 阅读全文
posted @ 2012-01-04 16:02 DavidHHuan 阅读(327) 评论(1) 编辑
摘要: That is just a simple example here:<?php/****Export&importsql**@authordavidhhuan*/classDLDatabaseHelper{/***Exportthesqltoafile**@authordavidhhuan*@parambool$withData:Whethertoexporttheinsert-dataatthesametime*@parambool$dropTable:Addtodropthetableornot*@paramstring$saveName:thesavedfilename*阅读全文
posted @ 2011-12-30 00:03 DavidHHuan 阅读(2455) 评论(0) 编辑
摘要: 遇到一个情况,就是用 jquery ajax 调用的数据,有两种情况:一是普通字符串;二是 json 格式;这样的话就要根据不同的返回值来处理了。google了一下,发现通过正则是比较简单的方法了,代码如下:$.ajax({type:'get',url:url,success:function(data){//判断返回值不是json格式if(!data.match("^\{(.+:.+,*){1,}\}$")){//普通字符串处理}else{//通过这种方法可将字符串转换为对象data=eval("("+data+")"阅读全文
posted @ 2011-12-28 10:01 DavidHHuan 阅读(3269) 评论(0) 编辑
摘要: javascript 如何在 ajax 直接传递数组呢?比如说,我有这样的数组:vararr=[1,2,3];在 $.ajax({})里面是不能直接传过去的!不过呢,如果把数组弄成是对象来操作的话,就没问题了,具体例子如下:vararr={};arr['block_301']={};arr['block_302']={};arr['block_301']['block_301_1']='block_301_1';arr['block_301']['block_301_2']='阅读全文
posted @ 2011-12-26 11:04 DavidHHuan 阅读(510) 评论(0) 编辑
摘要: functionhtml_encode(str){vars="";if(str.length==0)return"";s=str.replace(/&/g,"&gt;");s=s.replace(/</g,"&lt;");s=s.replace(/>/g,"&gt;");s=s.replace(//g,"&nbsp;");s=s.replace(/\'/g,"'");s=s.replace阅读全文
posted @ 2011-10-26 11:04 DavidHHuan 阅读(256) 评论(0) 编辑
摘要: Ubuntu系统升级到11.10,mysql启动不了,提示ERROR2002(HY000):Can'tconnecttolocalMySQLserverthroughsocket'/var/run/mysqld/mysqld.sock'(2)找来找去,发现原来真的没有这个文件。。。只有用终极办法,重装mysql卸载:sudoapt-getautoremove--purgemysql-server-5.0sudoapt-getremovemysql-serversudoapt-getautoremovemysql-serversudoapt-getremovemysql-阅读全文
posted @ 2011-10-15 10:41 DavidHHuan 阅读(242) 评论(0) 编辑
摘要: 这里用到了jquery的ajax。页面: $.ajax({type:'POST',url:'http://www.yourwebsite.com',beforeSend:function(XMLHttpRequest){XMLHttpRequest.setRequestHeader("request_type","ajax");},data:'test=test',success:function(rs){alert('ok');}}});PHP代码:echoisset($_SERVER[&阅读全文
posted @ 2011-09-30 14:20 DavidHHuan 阅读(533) 评论(2) 编辑
摘要: The article comes from:http://www.apaddedcell.com/easy-php-debugging-ubuntu-using-xdebug-and-vimA debugger helps greatly when testing or bug fixing in...阅读全文
posted @ 2011-09-28 22:18 DavidHHuan 阅读(466) 评论(0) 编辑
摘要: After i installed netbeans7.0, the language of is Chinese, thought i am a chinese, but of netbeans, i am not similar with the interface of Chinese, so i have to change the language to english.open the /path_to_netbeans/etc/netbeans.conf, add the code as below:netbeans_default_options="-J-client阅读全文
posted @ 2011-09-28 21:50 DavidHHuan 阅读(154) 评论(0) 编辑
共26页: 首页 上一页 7 8 9 10 11 12 13 14 15 下一页 末页