上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 28 下一页
摘要: As we know, in Yii, we can set the error handler to display some useful message to the user.But, when i want to display different views in different modules, how to do it?Here is the way.In your module, here let say we have a admin module, there isAdminModule.php in it,then add the code as below:pub 阅读全文
posted @ 2012-10-03 16:55 DavidHHuan 阅读(693) 评论(0) 推荐(0) 编辑
摘要: After updated the Ubuntu12.04 with the update-package, i run the virtualbox with Win7, then igot these errors: Failedtoopenasessionforthevirtualmachinewin7.Thevirtualmachine'win7'hasterminatedunexpectedlyduringstartupwithexitcode1.ResultCode:NS_ERROR_FAILURE(0x80004005)Component:MachineInter 阅读全文
posted @ 2012-10-02 10:05 DavidHHuan 阅读(969) 评论(0) 推荐(0) 编辑
摘要: 当使用一些开源的分享按钮,如 jiathis,我们可以在分享的时候,加入一些图片,如以 jiathis 为例,可以通过设置参数varjiathis_config={boldNum:0,siteNum:7,showClose:false,sm:"t163,kaixin001,renren,douban,tsina,tqq,tsohu",imageUrl:"http://v2.jiathis.com/code/images/r5.gif",imageWidth:26,marginTop:150,url:"http://www.jiathis.com 阅读全文
posted @ 2012-09-20 15:10 DavidHHuan 阅读(833) 评论(0) 推荐(0) 编辑
摘要: From the code generated by the yiic, as we know, using these code can only get id and username from Yii::app()->user after logined:$identity=newUserIdentity($_POST['LoginForm']['username'],$_POST['LoginForm']['password']);Yii::app()->user->login($identity);bu 阅读全文
posted @ 2012-09-07 14:01 DavidHHuan 阅读(432) 评论(0) 推荐(0) 编辑
摘要: Virtualbox实现虚拟机与主机互相访问,并且虚拟机成为主机所在局域网的一台可访问机器主机A:window XP sp3虚拟机B:window XP sp3在A使用VirtualBox里面搭建B,实现B与A互相访问,并且B成为A所在局域网的一台可访问机器,目的是为了测试不同的IE(纯净的IE,非使用那些IEtester,IEcollection)下面的网站显示,同时为了方便其它同事也能够使用B,所以才写下这篇文章来记录一下。安装VirtualBox在A里面安装VirtualBox,然后按照常规做法安装好B(详细过程可google之)。设置B的网络网卡1:网卡2:也就是说,网卡1使用桥接模式 阅读全文
posted @ 2012-08-31 11:54 DavidHHuan 阅读(937) 评论(0) 推荐(0) 编辑
摘要: i am developing a plugin for getting rss from a website which is utf-8, when loading the code from the site, i got these error:<type'exceptions.UnicodeDecodeError'>:'ascii'codeccan'tdecodebyte0xe5inposition9here is the code what i used before: title=entry_rss.title.encode(& 阅读全文
posted @ 2012-08-24 10:56 DavidHHuan 阅读(1765) 评论(0) 推荐(0) 编辑
摘要: 比如说,我有一个启动程序,想在桌面上面放一个图标,直接双击就可以打开。在桌面建立文件 my_app.desktop,注意后缀名是 .desktop,然后如下的代码:[DesktopEntry]Encoding=UTF-8Name=MyAPPComment=MyAPPiswonderfulExec=/bin/sh"/home/davidhhuan/Software/myapp/bin/myapp"Icon=/home/davidhhuan/Software/myapp/myapp.pngCategories=Application;Development;Java;IDEVe 阅读全文
posted @ 2012-08-15 11:02 DavidHHuan 阅读(412) 评论(0) 推荐(1) 编辑
摘要: 再谈Yii Framework中的事件event,我写过的关于Yii事件event的另一篇文章[Yii Framework] Yii中事件和行为的区别和应用 http://www.cnblogs.com/davidhhuan/archive/2012/01/19/2326123.html假设有类MyComponent,它是继承于CComponent,通过查看 CComponent 的 __set() 方法,publicfunction__set($name,$value){$setter='set'.$name;if(method_exists($this,$setter))r 阅读全文
posted @ 2012-07-23 16:28 DavidHHuan 阅读(724) 评论(0) 推荐(2) 编辑
摘要: This article comes fromhttp://www.yiiframework.com/wiki/155/the-directory-structure-of-the-yii-project-siteOverall StructureTop-level DirectoriesApplication DirectoriesThe Common DirectoryApplication ConfigurationsPath AliasDeploymentLinksIn this article, we describe the directory structure used by 阅读全文
posted @ 2012-07-19 11:43 DavidHHuan 阅读(1045) 评论(0) 推荐(0) 编辑
摘要: 这里假设我们要建立 中文/英文 切换的站点1. 设置全局默认的语言文件添加代码:protected/config/main.php'language'=>'zh_cn',2. 控制器根据用户选择动态切换语言一般来说,我们所有的控制器都是继承于 protected/components/Controller.php 这个类。因此,我们可以在这个类里面进行语言的定义来影响当前的请求。publicfunctioninit(){if(isset($_GET['lang'])&&$_GET['lang']!=" 阅读全文
posted @ 2012-06-15 15:47 DavidHHuan 阅读(33219) 评论(3) 推荐(1) 编辑
摘要: 以下代码兼容ie6+,firefox和chrome,目的是,使图层半透明,而文字不透明。<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"con 阅读全文
posted @ 2012-06-02 20:15 DavidHHuan 阅读(1691) 评论(0) 推荐(0) 编辑
摘要: I have reinstalled my system to Ubuntu 12.04, after installed mysql, i found that there is an error when start mysql:Accessdeniedforuser‘debian-sys-maint’@'localhost’(usingpassword:YES)After searching the reason via google, i at last found the reason, here is it:That’sbecausedebianhasamysqlaccou 阅读全文
posted @ 2012-05-19 10:34 DavidHHuan 阅读(2273) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://www.dotblogs.com.tw/cross/archive/2010/09/21/17840.aspxgoogle了很久,基本上都是用 activeX 来实现~至于为什么不行,这个不多说,说一下以下方法:已经测试通过的浏览器:IE6+,firefox,chrome,其中 firefox 和 chrome 要能支持 HTML5。<html><head><metahttp-equiv="Content-Type"content="text/html;charset=big5"><tit 阅读全文
posted @ 2012-02-29 15:00 DavidHHuan 阅读(1120) 评论(0) 推荐(0) 编辑
摘要: /****用来判断数组是否包含某个元素*@authorniaoren2011-12-27*/Array.prototype.S=String.fromCharCode(2);Array.prototype.in_array=function(e){varr=newRegExp(this.S+e+this.S);return(r.test(this.S+this.join(this.S)+this.S));}/***删除指定下标的元素**@authorniaoren2012-02-28*/Array.prototype.remove=function(index){if(isNaN(index) 阅读全文
posted @ 2012-02-28 18:12 DavidHHuan 阅读(372) 评论(0) 推荐(0) 编辑
摘要: It is very easy to generate phpdoc in NetBeans, just follow these steps, and you will see the amazing things :)Step 1: Download the PhpDoc:http://www.phpdoc.org/Step 2:Extract the file you downloaded.Step 3:Launch the Netbeans. Tools -> Options, see the details in the image below: Remember to cha 阅读全文
posted @ 2012-02-26 01:08 DavidHHuan 阅读(330) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 28 下一页