摘要: 这个其实最简单在对应的model里找Search方法找到后,参见如下代码 public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; $criteria->compare('nid',$this->nid); $criteria->compare('cid',$this->cid); $criteria-> 阅读全文
posted @ 2013-11-03 17:31 Debm.Zhang 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 效果图参照http://www.yiiframework.com/doc/api/1.1/CGridColumn http://www.yiiframework.com/doc/api/1.1/CGridView http://www.yiiframework.com/forum/index.php/topic/30694-cgridview-filter-dropdown-from-array/(*)代码search(); $filter = Category::model()->findAll(); $this->widget('zii.widgets.grid.CGr 阅读全文
posted @ 2013-11-03 17:27 Debm.Zhang 阅读(716) 评论(0) 推荐(0) 编辑
摘要: 发布的新闻或介绍里有图片,图片存的是Url地址,通过yii的cgridview,默认是数据库里存的啥就显示啥,如何把url地址转为图片?直接上代码search();//全部数据 P.S 分页设置在News.php里 aptionSearch方法实现 //分页显示数据,如下所写,分页有效,筛选无效 /*$data = new CActiveDataProvider('News', array( 'pagination' => array( 'pageSize' => 2, ), ));*/ $filter = Category::mod 阅读全文
posted @ 2013-11-03 17:05 Debm.Zhang 阅读(1103) 评论(0) 推荐(0) 编辑