摘要: There are two methods to do that: 1. ezhttp("myvariable", "get", TRUE);2. ezhttp_hasvariable("myvariable", "get");The second method is recommand to use.~ 阅读全文
posted @ 2010-05-04 12:02 DavidHHuan 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 下面语句就可以获取当前控制器的名称了!Yii::app()->controller->id 阅读全文
posted @ 2010-04-21 11:56 DavidHHuan 阅读(743) 评论(0) 推荐(0) 编辑
摘要: <?php$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id'=>'myJuiDialog','options'=>array('title'=>'Edit the user profile','autoOpen'=>false,'buttons'=>array('ok'=>"js:f... 阅读全文
posted @ 2010-04-21 11:56 DavidHHuan 阅读(702) 评论(0) 推荐(0) 编辑
摘要: 第一,比如说,我们要使用 Zend framework的东西。我们把zend framework解压到 prtected/vendors里面,现在的文件夹为 protected/vendors/Zend/Search/Lucene.php第二,在controller文件的头部,插入下面代码。Yii::import(’application.vendors.*’);requi... 阅读全文
posted @ 2010-04-21 11:55 DavidHHuan 阅读(919) 评论(0) 推荐(0) 编辑
摘要: 要创建一个新的挂件(widget),我们主要是要继承两个方法:CWidget::init()和 CWidget::run(),CWidget::init 调用是发生在我们使用 $this->beginWidget 将挂件插入到一个view里面,CWidget::run 调用是发生在我们使用 $this->endWidget 这个方法的时候。 如果我们想捕捉和处理两者之间的方法核查办上显... 阅读全文
posted @ 2010-04-21 11:55 DavidHHuan 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 比如要使用mySQL中的md5函数,Test::model()->findAll(new CDbExpression("md5(name) =1")); 阅读全文
posted @ 2010-04-21 11:55 DavidHHuan 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 假设数据库的设置已经弄好了,里面的有一个User表建立User模型model User建立User的CRUD行为crud User创建 Modulemodule forum 阅读全文
posted @ 2010-04-21 11:54 DavidHHuan 阅读(543) 评论(0) 推荐(0) 编辑
摘要: 把/media/MyDocuments/xampp/htdocs/myyii下面的index.php复制到/media/MyDocuments/xampp/htdocs/myyii/protected下面,然后将下面的代码$yii=dirname(__FILE__).'/framework/yii.php';$config=dirname(__FILE__).'/protected/config/... 阅读全文
posted @ 2010-04-21 11:54 DavidHHuan 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 创建应用,假设yii的核心文件夹framework是放在/media/MyDocuments/xampp/htdocs/myyiicd /media/MyDocuments/xampp/htdocs/myyiiphp framework/yiic.php webapp /media/MyDocuments/xampp/htdocs/myyii 阅读全文
posted @ 2010-04-21 11:54 DavidHHuan 阅读(420) 评论(0) 推荐(0) 编辑
摘要: <?php return array( 'class'=>'CUrlManager', 'urlFormat'=>'path', 'urlSuffix'=>'.html', 'showScriptName'=>false, 'caseSensitive'=>false,//it makes route case-insensitive. 'rules'=>... 阅读全文
posted @ 2010-04-21 11:53 DavidHHuan 阅读(611) 评论(0) 推荐(0) 编辑
摘要: mysql:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--'db'=array('connectionString'='mysql:host=localhost;dbname=tsmp','username'='root','password'='1','charset'='utf8', 'tablePrefix'='tbl_',//'schemaCachingDuration'=3600,//如果在main.php里面设置了c 阅读全文
posted @ 2010-04-21 11:53 DavidHHuan 阅读(783) 评论(0) 推荐(0) 编辑
摘要: public function filters(){ return array( ’postOnly + edit, create’, array( ’application.filters.PerformanceFilter - edit, create’, ’unit’=>’second’, ... 阅读全文
posted @ 2010-04-21 11:52 DavidHHuan 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 创建[代码]调用[代码] 阅读全文
posted @ 2010-04-21 11:52 DavidHHuan 阅读(833) 评论(10) 推荐(1) 编辑
摘要: main.php文件'modules' => array( 'admin' => require(dirname(__FILE__).DIRECTORY_SEPARATOR.'backend.php') )backend.php文件<?phpreturn array( //'sizePerPage' => 10, 'defaultController'=>'user'... 阅读全文
posted @ 2010-04-21 11:52 DavidHHuan 阅读(809) 评论(0) 推荐(0) 编辑
摘要: class MyWidget extends CWidget{public function init(){// this method is called by CController::beginWidget()}public function run(){// this method is called by CController::endWidget()}}通常,widget的视图是是放... 阅读全文
posted @ 2010-04-21 11:51 DavidHHuan 阅读(584) 评论(0) 推荐(0) 编辑